是否可以使用 gdb 保存/转储核心文件?有时我想保存文件以便稍后分析。
最佳答案
在 gdb 中发出“generate-core-file”命令。
(gdb) help generate-core-file
Save a core file with the current state of the debugged process.
Argument is optional filename. Default filename is 'core.<process_id>'.
(gdb) break main
Breakpoint 1 at 0x400e0b: file utils/udec.c, line 36.
(gdb) r
Starting program: /home/nos/build/utils/udec
Breakpoint 1, main (argc=1, argv=0x7fffffffe9a8) at utils/udec.c:36
36 int fileargc = 1;
(gdb) generate-core-file
Saved corefile core.7336
关于gdb - 在 gdb 中保存核心文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3789550/