How do I pretty-print structures (specifically Vec
s) in rust-gdb
or plain gdb
? Whenever I call p some_vector
I get this result:
collections::vec::Vec<usize> = {buf = alloc::raw_vec::RawVec<usize> = {ptr = core::ptr::Unique<usize> = {pointer = core::nonzero::NonZero<*const usize> = {
0x7ffff640d000}, _marker = core::marker::PhantomData<usize>}, cap = 16}, len = 10}
This is just unreadable. Is there any way to get a result showing the contents of the Vec
? I am using Rust 1.12 and GDB 7.12.
rust-gdb
I'm getting things like$1 = Vec<i32>(len: 2, cap: 2) = {1, 2}
. Ingdb
on the other hand, I'm getting something closer to what you have. Have you really triedrust-gdb
? – Schilitgdb
, and still the nicer one withrust-gdb
. – Schilitrust-gdb
pretty-printers are in fact installed, usinginfo pretty-printer
. – Isoplethrust-gdb
(even thoughinfo pretty-printer
listsrust_pretty_printer_lookup_function
)... – Showcase