解决gdb 调试 core 文件函数名显示为问号的问题

关于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&
  • 2
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值