GNU Toolchain Update – GDB now supports Rust
gcc.gnu.org
gcc.gnu.org
lldb is to llvm/clang what gdb is to gcc and co.
Upstream support gets us:
- Native pretty print
- Expression evaluation. You can now `print foo(bar).baz().1` and it works
It doesn't support running arbitrary rust code. But you can access fields and make calls and use indexing/ranges/etc. You can't do things like use an if block.
Ok indexing and function calls, makes sense. It won't dispatch on types at all for polymorphic functions I assume.
Trait methods don't work, though you can call them directly as functions if you wish.
Basically everything else that you would use at the source level could be built on top of those.
Maybe this is the start of a new underwear project: A debugger in [part of] the spirit of Acid, but built on top of the lldb library.
...I put in the star to say that the Python API didn't count, but forgot to actually elaborate on it.
So when you say it's not good I guess you want to do other things (which?) - or else you mean that it's messy (if so I ought to say that I've seen much worse and in relative terms I'd say gdb's API is rather lovely.)
Having it in gdb itself means less work for people who want to use it. Rust ships with gdb/lldb pretty printers, but not everyone knows about them.
Also, without a stable abi I'd caution against having a separate frontend. The language "standard" isn't ready yet, either; it doesn't exist as a single document.
Latest example being Spyglass that was recently posted in HN.