如何解决如何在gdb中列出结构信息?
| 我可以检查非结构类型,但是当检查结构时,总是得到\“Function \"struct\" not defined.
\”:
(gdb) l ngx_http_request_t
10
11 #include <ngx_config.h>
12 #include <ngx_core.h>
13
14
15 typedef struct ngx_http_request_s ngx_http_request_t;
16 typedef struct ngx_http_upstream_s ngx_http_upstream_t;
17 typedef struct ngx_http_cache_s ngx_http_cache_t;
18 typedef struct ngx_http_file_cache_s ngx_http_file_cache_t;
19 typedef struct ngx_http_log_ctx_s ngx_http_log_ctx_t;
(gdb) l struct ngx_http_request_s
Function \"struct\" not defined.
gdb中可能吗?
解决方法
试试
ptype ngx_http_request_t
,l
通常与行号一起使用以查看特定的代码行,尽管它可以与函数名一起使用。
由于“ 4”不是行号或函数名,因此无法查看其定义。
您期望什么类型的输出?
看起来您确实想要struct
中的数据值,这意味着您必须首先创建该类型的结构。
,您可以打印用该类型声明的变量的值:
ngx_http_request_t foo;
(gdb)打印foo
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。