Debugging Quest Update
There have been a few changes in the Rust Debugging Quest and it’s finally time for an update. I’ll also talk a bit about planned changes.
GDB 8.2
A few Rust-related bug fixes are in GDB 8.2, the newest release. Nothing earth-shattering here, as the Rust support in GDB is rather stable; but ptype/o (a pahole-like command) now works for Rust. You can see the list of bugs here.
One thing I’ve been contemplating is shipping GDB via rustup. This would let us roll out Rust-related fixes more quickly. There is a rust bug tracking this.
Rust-enabled LLDB
Primary development on the Rust plugin for LLDB is done, and the rust-enabled LLDB is now shipping via rustup.
Currently LLDB is a preview and only in nightly, and only on macOS. In order for this to work, you must be using rustup 1.14.0 (or later, presumably), which was released yesterday. Earlier versions of rustup did not preserve symlinks at install time, causing lldb crashes. You can update rustup and install lldb with
$ rustup self update
$ rustup component add lldb-preview --toolchain nightly
Note that this does not put an lldb executable in your PATH. This was deemed too risky. Instead, the rust-lldb wrapper was modified to run the rust-enabled lldb if it is available. So, use rust-lldb to start it.
If you find bugs – and you will – in the rust-enabled lldb, please report them to the rust lldb github issue tracker.
The rust plugin for lldb understands the rustc-generated DWARF a bit better than the C++ plugin, and this will only become more pronounced as more debuginfo changes go into rustc. It also uses Rust syntax for expressions. It is roughly on par with GDB, but less tested.
Perhaps in the future we’ll ship LLDB on more platforms, not just macOS. There is some discussion in this rust issue.
Debuginfo Changes
No actual debuginfo change have landed yet. Better support for optimized enums is in the works, but as you can see that’s been a long slog.
However, once that goes in, it will be time to prioritize the to-do list. I’ll write that up soon, but meanwhile one possibility for the next change would be representing traits in DWARF. This would enable method calls via traits, which can’t be done today.
If you have specific things that are painful, I’d like to hear about them. You can just reply to this note. No promises of course, but this sort of information helps with sorting the to-do list.