dumping C structure sizes from ELF object file

前端 未结 4 1967
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-01 09:16

How can you extract the sizes of all C structures from an ELF object file with debugging symbols?

Individual struct sizes can be obtained from GDB using \"print sizeof(s

4条回答
  •  忘了有多久
    2021-02-01 09:32

    Install package dwarves, then you have the command "pahole".

    Use the "pahole" command against a elf object file, you can get all the structure information, or you can use the "-C" parameter to specific a structure name, for example:

    $ pahole vmlinux -C task_struct

提交回复
热议问题