Can GDB print the size of structures from a core dump of a C program?

后端 未结 2 688
后悔当初
后悔当初 2021-01-07 17:29

I\'m using GDB to analyze a core dump of a C program. Is it possible to print the size of a struct in the program?

2条回答
  •  南笙
    南笙 (楼主)
    2021-01-07 17:59

    have u tried "sizeof"?

    the complier may do the byte alignment automatically by default,so this size may be greater than you think

提交回复
热议问题