vadimcn / codelldb

A native debugger extension for VSCode based on LLDB
https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb
MIT License
2.49k stars 236 forks source link

Optimize restart times by supporting RestartRequest natively #583

Open mam-ableton opened 2 years ago

mam-ableton commented 2 years ago

From what I can see, vscode-lldb doesn't support the RestartRequest in the Debugger Adapter Protocol.

My assumption then is that hitting the restart button in VSCode falls back to the emulation described in the docs:

If the capability is missing or has the value false, a typical client will emulate 'restart' by terminating the debug adapter first and then launching it anew. https://microsoft.github.io/debug-adapter-protocol/specification

This works, but is a bit slow because lldb needs to fully relaunch itself, loading the binary and libraries in the process.

However, lldb natively supports efficient restarts that are much faster, since libraries are skipped: https://stackoverflow.com/questions/58125753/how-to-preserve-lldb-session-between-builds. This is what happens when the run command is re-executed within an existing lldb debug session.

Can vscode-lldb implement a RestartRequest handler that restarts an existing lldb session, rather than creating a new one ? That would greatly improve the restart user experience – from my testing on the CLI, restarting is several times faster on the cli than in vscode-lldb

thanks!

vadimcn commented 2 years ago

This is essentially the same request as #531. As I said there, at the moment I don't have the time to work on any new features. For now, you can the workaround mentioned in that issue.