问题描述
|
我可以检查非结构类型,但是当检查结构时,总是得到\“
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