4 ms·
gdb has technically supported Rust for some time, although Rust has distributed a pretty-printing wrapper (rust-gdb) to fix variable naming and some other items
by dikaiosune 10y ago
gdb has technically supported Rust for some time, although Rust has distributed a pretty-printing wrapper (rust-gdb) to fix variable naming and some other items, but having upstream support is pretty awesome.
- Manishearth 10y agoWell, gdb used to "support" rust in that we pretended to be C and it supports C :) Upstream support gets us: - Native pretty print - Expression evaluation. You can now `print foo(bar).baz().1` and it works
- Ericson2314 10y agoHow smart is the evaluation?
- Manishearth 10y agoWhat do you mean by "smart"? 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.
- Ericson2314 10y agoI mean what sorts of expressions it supports, and how lax are the typing rules of them, basically. Ok indexing and function calls, makes sense. It won't dispatch on types at all for polymorphic functions I assume.
- Manishearth 10y agoRight, types aren't involved much. IIRC method dispatch on preexisting monomorphizations work. Gdb will not monomorphize for you. Trait methods don't work, though you can call them directly as functions if you wish.