I’m working on a port of rust to another platform and I’m trying to debug a crash in one of the internal functions.
I built a copy of gdb 7.12.1 and was trying to figure out the syntax for specifying types when printing values.
This seems to work for the most part:
(gdb) ptype syntax::ast::Ident
type = struct syntax::ast::Ident {
name: syntax::symbol::Symbol,
ctxt: syntax::ext::hygiene::SyntaxContext,
}
However, some cases produce unexpected results:
(gdb) ptype syntax::ast::Mod
type = struct syntax::ast::Mod {
RUST$ENUM$DISR: syntax::ast::ItemKind,
__0: syntax::ast::Mod,
}
Does not match what I expect from src/libsyntax/ast.rs:
pub struct Mod {
/// A span from the first token past `{` to the last token until `}`.
/// For `mod foo;`, the inner span ranges from the first token
/// to the last token in the external file.
pub inner: Span,
pub items: Vec<P<Item>>,
}
Is this expected? What are the caveats when attempting to debug the rust compiler itself? The rust compiler was built with debug info and without optimizations enabled for debugging purposes.