关于gdb调试core文件总是一堆问号的问题
问题描述:已经在编译选项中加入了-g,但是查看core文件时,还是一堆问号,使用的命令为:gdb -c core
解决方案:由于gdb -c core这样的使用在有些系统下支持不是很好,所以推荐用如下两种方法:
1) gdb exe
(gdb) core-file core
2) gdb -c core
(gdb) file exe
而其中第二种方法在某些系统上也是不好用的,所以就用第一种即可。
Pre-Condition: ulimit -c unlimited
[root@localhost CMarketServer_dist]# gdb -c core.18669
GNU gdb (GDB) Red Hat Enterprise Linux (7.2-83.el6)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Missing separate debuginfo for the main executable file
Try: yum --enablerepo='*-debug*' install /usr/lib/debug/.build-id/3a/1542385962343e7f59102500bd59549476af63
[New Thread 18682]
[New Thread 18680]
[New Thread 18690]
[New Thread 18671]
[New Thread 18675]
[New Thread 18684]
[New Thread 18673]
[New Thread 18683]
[New Thread 18670]
[New Thread 18681]
[New Thread 18692]
[New Thread 18672]
[New Thread 18674]
[New Thread 18685]
[New Thread 18686]
[New Thread 18669]
[New Thread 18688]
[New Thread 18693]
[New Thread 18676]
[New Thread 18691]
[New Thread 18687]
[New Thread 18679]
[New Thread 18678]
[New Thread 18677]
[New Thread 18689]
Core was generated by `./CMarketServer'.
Program terminated with signal 11, Segmentation fault.
#0 0x00007f01d0000078 in ?? ()
(gdb) file ./CMarketServer
Reading symbols from /home/artogrid/workspace/deploy/CMarketServer_dist/CMarketServer...done.
(gdb) set solib-search-path .
Missing separate debuginfo for /usr/local/lib/liblog4cxx.so.10
Try: yum --enablerepo='*-debug*' install /usr/lib/debug/.build-id/0e/139ae220b73d9a39339f1bace6a96a38c1c44a
warning: Ignoring non-absolute filename: <libqpid_engine.so>
Missing separate debuginfo for libqpid_engine.so
Try: yum --enablerepo='*-debug*' install /usr/lib/debug/.build-id/45/564f720db2e65548b71adb8b24b8c36b19d2f5
warning: Ignoring non-absolute filename: <libsdbus.so&