gdb supports the Rust Programming Language. Type- and value-printing, and expression parsing, are reasonably complete. However, there are a few peculiarities and holes to be aware of.
extern crate
behaves.
That is, if gdb is stopped at a breakpoint in a function in
crate ‘A’, module ‘B’, then break B::f
will attempt
to set a breakpoint in a function named ‘f’ in a crate named
‘B’.
As a consequence of this approach, linespecs also cannot refer to items using ‘self::’ or ‘super::’.
print ::x::y
will try to find the symbol
‘K::x::y’.
However, since it is useful to be able to refer to other crates when
debugging, gdb provides the extern
extension to
circumvent this. To use the extension, just put extern
before
a path expression to refer to the otherwise unavailable “global”
scope.
In the above example, if you wanted to refer to the symbol ‘y’ in
the crate ‘x’, you would use print extern x::y
.
if
or match
, or lambda expressions.
Drop
trait. Objects that may be created by the evaluator will
never be destroyed.
crate::f<u32>
, where the parser would require
crate::f::<u32>
.
Self
is not available.
use
statements are not available, so some names may not be
available in the crate.