GDB断点失效(2)

博主遇到GDB断点失效的问题,程序在打到断点时直接退出,提示SIGTRAP错误。通过查找资料发现可能是因为缺少libthread_db.so.1库。尽管按照文档配置后问题仍未解决,最终发现是使用的GDB版本与目标板不匹配导致,更换正确版本的GDB后问题得到解决。
摘要由CSDN通过智能技术生成

上一篇说过,GDB使用的时候表现很奇怪,

线程都看不到,只能看到主线程,打其他线程的断点,都失效。

刚刚把源码也放到目录下,断点是打到了,但是同时程序也退出了。

提示信息如下:

Program terminated with signal SIGTRAP, Trace/breakpoint trap.

百度之后,发现GDB WIKI里有一个问题描述很类似。

http://sourceware.org/gdb/wiki/FAQ#GDB_does_not_see_any_threads_besides_the_one_in_which_crash_occurred.3B_or_SIGTRAP_kills_my_program_when_I_set_a_breakpoint.

<span style="font-size:18px;">GDB does not see any threads besides the one in which crash occurred; 
or SIGTRAP kills my program when I set a breakpoint.</span>

    This frequently happen on Linux, especially on embedded targets. There are two common causes:

     (1)   you are using glibc, and you have stripped libpthread.so.0

     (2)   mismatch between libpthread.so.0 and libthread_db.so.1 

    GDB itself does not know how to decode "
  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值