dumping C structure sizes from ELF object file

前端 未结 4 2004
佛祖请我去吃肉
佛祖请我去吃肉 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:35

    Unless someone else known something, I think you will have to process the output of nm .

    However, nm only gives you the start of each struct and knows nothing about its end so even that may not work unless each strut is immediately followed by some other symbol. Watch out for this issue!

提交回复
热议问题