如何显示结构在GDB中有哪些字段? [英] How do I show what fields a struct has in GDB?

查看:190
本文介绍了如何显示结构在GDB中有哪些字段?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在GDB会话中遇到了一个名为 ngx_http_variable_value_t 的结构,我想打印它在控制台中的字段。

I came upon a struct called ngx_http_variable_value_t in my GDB session and I would like to print what fields it has in the console.

是否有可能?

推荐答案

您可以使用GDB命令 ptype 打印结构或类的定义。

You can use the GDB command ptype to print out the definition of a struct or class.

这篇关于如何显示结构在GDB中有哪些字段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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