Interesting idea. I think I already enabled debug info in the release build with
debug = true
Cargo.toml. If not, please let me know.
I’m using GDB to debug. When I try to
print var, GDB just tells me the the variable is optimized away, which is why I’ve resorted to tracking down values using registers and offsets. I may be reading the assembly wrong, but it seems like one struct I’ve encountered did not exist in contiguous memory (…I hope I’m wrong about this). Rather the fields were in registers
r15. and arbitrarily offloaded into memory–on the stack, I think, if
($rbp-0xf0) is a stack expression on x86_64.
whatis var does tell me the type of a variable (e.g.
std::collections::VecDeque), but no futher info about the struct.
So, I don’t think I’ll achieve the seamless experience without more configuration. Is there a command in GDB that will print struct info with the ordering?
I hadn’t considered the debug info would contain details on struct ordering. Maybe on of the other linux bin-utils (
readelf) might print that info. Thanks for that.