whatis 是GDB用来判断变量的类型的。是相当好用的一个功能。
(gdb) b main
Breakpoint 12 at 0x403509: file src/core/nginx.c, line 201.
(gdb) whatis main
type = int (int, char * const *)
(gdb) whatis 0x403509
type = int
(gdb) whatis (0x403509)
type = int
唯一美中不足的地方,就是没有办法根据地址来寻找变量的类型。ptype是类似的命令。