3 ms·
You can get it from debuginfo - just load your binary into any debug session (this might even work with no execution or core dump, just a blob of memory that fr
by eddyb 9y ago
You can get it from debuginfo - just load your binary into any debug session (this might even work with no execution or core dump, just a blob of memory that from your program) and then you can cast char* to YourRustType* to be able to introspect it.
On top of that, on nightly you have this flag:
-Z print-type-sizes -- print layout information for each type encountered
This is what the output looks like: https://github.com/rust-lang/rust/blob/13fd5e93deb41045c4de88c257d2b02ada2b1730/src/test/ui/print_type_sizes/padding.stdout https://github.com/rust-lang/rust/blob/13fd5e93deb41045c4de8...