GDB可以从C程序的核心转储中打印结构的大小吗? [英] Can GDB print the size of structures from a core dump of a C program?

查看:109
本文介绍了GDB可以从C程序的核心转储中打印结构的大小吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用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?

推荐答案

这些都应该在GDB中工作 -g ):

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

print sizeof(var)
print sizeof(Type)

这篇关于GDB可以从C程序的核心转储中打印结构的大小吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆