daveleroy / SublimeDebugger

Graphical Debugger for Sublime Text for debuggers that support the debug adapter protocol
MIT License
371 stars 44 forks source link

Attempting to debug rust program with LLDB #160

Closed shot-codes closed 2 years ago

shot-codes commented 2 years ago

Firstly, awesome package, thanks for making it open source. I am attempting to debug a rust program with LLDB, I am trying two separate approaches, each with their own issue. The first thing I am trying to do is to is copy vscodes configuration which judging by the json works through cargo (see the first configuration in the first screenshot below). I'm notified that the "program" property is required for launch I figure this is probably not unexpected. I then try to set the program as asked (see second configuration in the first screenshot) and this seemingly works but I am thrown into the compiled assembly. (see second screenshot). Any help with this would be greatly appreciated. :) Screen Shot 2022-05-13 at 11 28 45 Screen Shot 2022-05-13 at 11 31 15

daveleroy commented 2 years ago
Screen Shot 2022-05-13 at 12 15 40 PM

Should just need to toggle off Disassembly in the menu there or the command palette.

Any options that vscode-lldb implements outside the debug adapter and inside the vscode extension won't work. Presumably they fill in the program path automatically when using the cargo option.

shot-codes commented 2 years ago

Thanks, that did the trick. Now I will just look into how I can get it to build when I run the debugger. I imagine I'll find my answer to that in the docs for the adapter on vscode.

daveleroy commented 2 years ago

Building isn't part of the debug adapter protocol but you should be able to use the pre_debug_task field in a configuration which will be run before starting the debug adapter.

See https://github.com/daveleroy/sublime_debugger#tasks

Check out the C++ examples since they use this feature https://github.com/daveleroy/sublime_debugger/blob/master/examples/cpp/cpp.sublime-project

shot-codes commented 2 years ago

Thanks for the info, I'll look into it.