gdbinit ptype offsetof
(gdb) p offsetof( struct net_device,mtu)
$1 = (unsigned int *) 0x240 <irq_stack_union+576>
(gdb) shell cat ~/.gdbinit
macro define offsetof(t, f) &((t *) 0)->f)
(gdb)
有时候,不小心知道了一些事,才发现自己所在乎的事是那么可笑。
(gdb) p offsetof( struct net_device,mtu)
$1 = (unsigned int *) 0x240 <irq_stack_union+576>
(gdb) shell cat ~/.gdbinit
macro define offsetof(t, f) &((t *) 0)->f)
(gdb)