llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.33k stars 12.13k forks source link

[lldb-dap] Vscode jump to cursor #109335

Open fr43nk opened 2 months ago

fr43nk commented 2 months ago

Hi,

is it possible to add a debug feature called "Jump To Cursor" to the context menu in a vscode editor while debugging? "Goto Cursor" already exists, so the new feature is an addition.

Best regards, Frank

vogelsgesang commented 2 months ago

Does the jump command (in the Debug Console) do what you are looking for?

fr43nk commented 2 months ago

Hi @vogelsgesang, yes, this looks like the right command. Question: when I use this in debug console, there is no visual update in the editor window, for the current highlighted line. Is that by intension and would be solved, if the jump command is triggered from the ui?

vogelsgesang commented 1 month ago

I guess that lldb-dap would have to send a new "Stopped" event in this case to trigger an update in the UI

vogelsgesang commented 1 month ago

Looking at the code base, this might be fixed by listening to the eBroadcastBitStackChanged event in EventThreadFunction inside lldb-dap.cpp and sending a "Stopped" event in those cases. However, I am not sure in which exact cases lldb actually triggers this event. Not sure if this is appropriate or if it would be too noisy.

I don't have time to look into this myself currently, but feel free to experiment with this yourself and open a PR in case you find a good solution