开发者

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

开发者 https://www.devze.com 2023-02-24 12:39 出处:网络
I\'m using GDB to ana开发者_StackOverflow社区lyze a core dump of a C program. Is it possible to print the size of a struct in the program?These should all work in GDB (assuming you compiled with -g):

I'm using GDB to ana开发者_StackOverflow社区lyze a core dump of a C program. Is it possible to print the size of a struct in the program?


These should all work in GDB (assuming you compiled with -g):

print sizeof(var)
print sizeof(Type)


have u tried "sizeof"?

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号