Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


Well, 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


How smart is the evaluation?


What 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.


I 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.


Right, 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: