当将核心转储加载到GDB中时,会显示其自动崩溃的原因。例如
程序终止信号11,分割故障。
有什么办法能再得到这些信息吗?问题是,我正在写一个需要这些信息的脚本。但是,如果信号只有在加载核心转储之后才可用,那么稍后我就无法访问这些信息。
这样一个重要的特性真的没有命令吗?
发布于 2012-01-17 19:56:05
如果您知道核心文件名是什么,您可以发出target core命令,该命令响应目标核心文件:
(gdb) target core core.8577
[New LWP 8577]
Core was generated by `./fault'.
Program terminated with signal 11, Segmentation fault.
#0 0x080483d5 in main () at fault.c:10
10 *ptr = '\123';
(gdb) 至于隐含的问题,什么是info last signal命令?,我不知道。似乎没有一个。
可以从命令info target获得核心文件的名称
(gdb) info target
Symbols from "/home/wally/.bin/fault".
Local core dump file:
`/home/wally/.bin/core.8577', file type elf32-i386.
0x00da1000 - 0x00da2000 is load1
0x08048000 - 0x08049000 is load2
...
0xbfe8d000 - 0xbfeaf000 is load14
Local exec file:
`/home/wally/.bin/fault', file type elf32-i386.
Entry point: 0x8048300
0x08048134 - 0x08048147 is .interp
0x08048148 - 0x08048168 is .note.ABI-tag
0x08048168 - 0x0804818c is .note.gnu.build-id
0x0804818c - 0x080481ac is .gnu.hash
0x080481ac - 0x080481fc is .dynsym
0x080481fc - 0x08048246 is .dynstr
...发布于 2012-01-22 22:34:56
打印有关上一次信号执行的信息
p $_siginfohttps://stackoverflow.com/questions/8897761
复制相似问题