如何在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     

要回复问题请先登录注册