break-insert for lldb-mi no longer requires 'on'
See original GitHub issueIn this line, we have a comment that break-insert
requires on
for lldb-mi: https://github.com/microsoft/MIEngine/blob/2bb9706607edf0ce839bab4eb131adc8a555b6ec/src/MIDebugEngine/Engine.Impl/DebuggedProcess.cs#L872
This is no longer true (presumably, it has been fixed upstream in lldb-mi): https://github.com/lldb-tools/lldb-mi (maybe this change: https://github.com/lldb-tools/lldb-mi/commit/e448e35a9e4da5b5a4f0f80530ba30d5a619cb3e#diff-16ecaed41b16ef0b1fd18b3f74b1a2f2).
I think fixing this will allow us to fix debugging on macOS using vscode-cpptools: https://github.com/microsoft/vscode-cpptools/issues/3829
Taking the latest version of lldb-mi from GitHub, and building it:
- Including
-break-insert -f on main
does not work:
lldbmitest) BenMBP:attach ben$ ../../build/src/lldb-mi
(gdb)
-file-exec-and-symbols ../testdata/simple/simple
^done
(gdb)
=library-loaded,id="/Users/ben/Development/llvm-project/lldb-mi/test/testdata/simple/simple",target-name="/Users/ben/Development/llvm-project/lldb-mi/test/testdata/simple/simple",host-name="/Users/ben/Development/llvm-project/lldb-mi/test/testdata/simple/simple",symbols-loaded="1",symbols-path="/Users/ben/Development/llvm-project/lldb-mi/test/testdata/simple/simple.dSYM/Contents/Resources/DWARF/simple",loaded_addr="-",size="4096"
-break-insert -f on main
^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0xffffffffffffffff",func="??",file="??",fullname="??/??",line="0",pending=["on"],times="0",original-location="on"}
(gdb)
=breakpoint-modified,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0xffffffffffffffff",func="??",file="??",fullname="??/??",line="0",pending=["on"],times="0",original-location="on"}
(gdb)
As you can see, the breakpoint is pending and has no file/line info.
- Including
-break-insert -f main
works:
(lldbmitest) BenMBP:attach ben$ ../../build/src/lldb-mi
(gdb)
-file-exec-and-symbols ../testdata/simple/simple
^done
(gdb)
=library-loaded,id="/Users/ben/Development/llvm-project/lldb-mi/test/testdata/simple/simple",target-name="/Users/ben/Development/llvm-project/lldb-mi/test/testdata/simple/simple",host-name="/Users/ben/Development/llvm-project/lldb-mi/test/testdata/simple/simple",symbols-loaded="1",symbols-path="/Users/ben/Development/llvm-project/lldb-mi/test/testdata/simple/simple.dSYM/Contents/Resources/DWARF/simple",loaded_addr="-",size="4096"
-break-insert -f main
^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0000000100000f26",func="main",file="simple.cpp",fullname="/Users/ben/Development/llvm-project/lldb-mi/test/testdata/simple/simple.cpp",line="15",pending=["main"],times="0",original-location="main"}
(gdb)
=breakpoint-modified,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0000000100000f26",func="main",file="simple.cpp",fullname="/Users/ben/Development/llvm-project/lldb-mi/test/testdata/simple/simple.cpp",line="15",pending=["main"],times="0",original-location="main"}
(gdb)
as you can see, this works and resolves the breakpoint, and we can see that the breakpoint is actually triggered, hence this lldb-mi could be used with MIEngine (via vscode-cpptools) to fix the macOS breakpoints-not-triggering issue (referenced above):
(gdb)
-exec-run
<snip uninteresting stuff>
(gdb)
*stopped,reason="breakpoint-hit",disp="del",bkptno="1",frame={level="0",addr="0x0000000100000f26",func="main",args=[{name="argc",value="1"}],file="simple.cpp",fullname="/Users/ben/Development/llvm-project/lldb-mi/test/testdata/simple/simple.cpp",line="15"},thread-id="1",stopped-threads="all"
(gdb)
I would send a PR to remove this lldb-mi workaround, but I can’t actually build this project as I don’t have Windows.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:15 (14 by maintainers)
Top GitHub Comments
Woo \o/. with the above PR (#950) and the latest
lldb-mi
including thenew-console
patch vimspector regression tests finally pass on macOS Catalina!Now, to fix vscode-python which doesn’t work with node 13.
@WardenGnaw I tried testing your
fixLLDB
branch, it doesn’t work - it just hangs. I think this is because it sends the command too early, or it never reads the command result ? Not sure.Here’s the output:
Looks to me like it’s never returning from
RequiresOnKeywordForBreakInsert()
Here’s my quick implementation of the new-console command for the record: