How can I see how a C++ class gets laid out in memory with gdb?
You can always print out the address of each member and this
to figure it out yourself (you use &
to get the member address, just like in the language itself).
I wish I knew.
You can use ptype to list members. Then you can fabricate a poor man's offsetof like this:
(gdb) p/a &((my_struct_*)0)->my_member
(gdb) p/a &((struct sk_buff*)0)->iif
$7 = 0x74