Given the following program: use std::collections::HashMap; fn main() { let m : HashMap<u32, Vec<u32>> = HashMap::new(); println!("Hello, world! {:?}", m); } print(gdb.parse_and_eval("m")["table"].type.template_argument(0)) gives a: RuntimeError: syntax error, near `>>' Error while executing Python code.
This happens because rustc doesn't emit DW_AT_template_type_param for the HashMap type. Then it interacts with a weird gdb/python thing -- in earlier times gcc also did not emit this template information, so the first iteration of this python layer code hacked around the omission by parsing the C++ name and extracting the type names. This code remains, so it still tries to do this as a fallback. I think this is apropos: https://github.com/rust-lang/rust/issues/9224
https://github.com/rust-lang/rust/issues/9224 seems to suggest that rustc is emitting DW_AT_template_type_param
(In reply to Jeff Muizelaar from comment #2) > https://github.com/rust-lang/rust/issues/9224 seems to suggest that rustc is > emitting DW_AT_template_type_param Not always. Consider this test (from that bug): pub struct Generic<T: Clone>(T); pub struct Normal(i32); fn main () { let generic = Generic(10); let normal = Normal(10); generic; normal; } Here the DWARF for Generic<i32> is just: <2><81>: Abbrev Number: 6 (DW_TAG_structure_type) <82> DW_AT_name : (indirect string, offset: 0x6e): Generic<i32> <86> DW_AT_byte_size : 4 <87> Unknown AT value: 88: 4 <3><88>: Abbrev Number: 7 (DW_TAG_member) <89> DW_AT_name : (indirect string, offset: 0x66): __0 <8d> DW_AT_type : <0xa8> <91> Unknown AT value: 88: 4 <92> DW_AT_data_member_location: 0 <3><93>: Abbrev Number: 0
See https://github.com/rust-lang/rust/pull/55010
The fix for this has been in rustc for a while now, so I am going to close this. If it's still a problem, please comment or reopen. Thanks.