GDB 可以从 C 程序的核心转储中打印结构的大小吗? [英] Can GDB print the size of structures from a core dump of a C program?
本文介绍了GDB 可以从 C 程序的核心转储中打印结构的大小吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
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?
解决方案
These should all work in GDB (assuming you compiled with -g
):
print sizeof(var)
print sizeof(Type)
这篇关于GDB 可以从 C 程序的核心转储中打印结构的大小吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文