nova-rust icon indicating copy to clipboard operation
nova-rust copied to clipboard

Debugging support

Open laralove143 opened this issue 2 years ago • 4 comments

Is your feature request related to a problem? Please describe. Nova has debugging support, Rust has debugging support (with LLDB, GDB and CDB), so why not put them together?

Describe the solution you'd like The debugging functionality present in many other IDEs. Supporting just LLDB would be enough for now.

Describe alternatives you've considered The LLDB extension, I couldn't get it to work (see the related issue), even then, I think having it directly in this extension would be good, maybe using the LLDB extension if possible.

laralove143 avatar Apr 10 '23 20:04 laralove143

I definitely considered providing debugger support when it launched with Nova 9. I haven't pursued it for a few reasons.

The primary reason was "because it's hard." I couldn't find a debug adapter that wasn't tightly coupled with an extension and that could be easily dropped in, like how Rust Analyzer is easy to use with any editor. I didn't have the time and energy to dive into whether forking an existing VS Code extension or rolling my own adapter would make more sense. It all seemed like more effort than what I could offer given my existing obligations.

A secondary reason is that it kind of makes sense for it to be a separate extension. Other languages like C could use gdb, lldb et al for debugging, so binding a debugger to only Rust would make it less useful for Nova users.

So I'm rooting for the LLDB extension to fix its issues since it looks like they're just getting started. Many extension developers have run out of steam, so I wish them luck!

kilbd avatar Apr 11 '23 22:04 kilbd

i asked some people, quoting them

does rust require a lot of special adaptation to work with lldb?

No. AFAIK there's a rust-lldb wrapper, but that's just an lldb wrapper to use python scripts to improve vec/slice/string visualization AFAIK? Basic inspection of integers etc. should work even without those wrappers.

as in could it work with a generic lldb extension for an ide?

Should yes, although you might benefit from customizing which lldb binary/script is launched by said generic extension.

adaptation "should" just be a matter of pointing at ~/.cargo/bin/rust-lldb(.exe) (that might assume rustup component add llvm-tools)

laralove143 avatar Apr 13 '23 16:04 laralove143

The adapter isn't for Rust to LLDB, but for Nova to LLDB. A debug adapter is something that "wraps" a debugger and communicates with an editor via JSON messages that conform to a specific protocol. It's very much modeled after LSP.

As I described above, I couldn't find an adapter that was easy to grab and drop in, nor could I commit to making one myself.

kilbd avatar Apr 21 '23 01:04 kilbd

should this be closed as part of nova-lldb? maybe when that extension gets fixed, it could have a place in this repo's documentation

laralove143 avatar Apr 21 '23 12:04 laralove143