gdb 调试任何程序都提示 “Program received signal SIGTRAP, Trace/breakpoint trap.”

jack_ooneil 2016-03-15 12:01:40
不知道什么原因导致的GDB出现这个问题。

以前GCC和GDB版本都比较低, 为了支持C++11我升级了GCC 到5.3.0版本, GDB升级到了7.11版本, 都是编译安装的。
编译helloworld 都出现这个信号,有谁遇到过这中问题吗?谢谢
...全文
8470 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
JoeBlackzqq 2018-01-25
  • 打赏
  • 举报
回复
哎,我也莫名的遇到了。果断去除所有断点,然后重新添加断点,解决! 可能是由于原先下完断点后,代码又编辑过,导致断点对应的行号对不上了,猜测!
heronism 2017-04-22
  • 打赏
  • 举报
回复
也遇到同样的问题了,楼主解决了说一下啊
老灰狼 2016-08-09
  • 打赏
  • 举报
回复
楼主解决了么?
zhxianbin 2016-03-16
  • 打赏
  • 举报
回复
这就不明白怎么回事了
jack_ooneil 2016-03-16
  • 打赏
  • 举报
回复
@zhxianbin 也不行 (gdb) start Temporary breakpoint 1 at 0x8048c46: file 12-1main.cpp, line 23. Starting program: /home/lpf/cpp/chapter12/a.out Program received signal SIGTRAP, Trace/breakpoint trap. 0x00367793 in _dl_debug_state () from /lib/ld-linux.so.2 (gdb) handle SIG5 nostop pass Unrecognized or ambiguous flag word: "SIG5". (gdb) handle SIGTRAP nostop pass SIGTRAP is used by the debugger. Are you sure you want to change it? (y or n) Y Signal Stop Print Pass to program Description SIGTRAP No Yes Yes Trace/breakpoint trap (gdb) c Continuing. Program terminated with signal SIGTRAP, Trace/breakpoint trap. The program no longer exists. (gdb) n The program is not being run.
zhxianbin 2016-03-15
  • 打赏
  • 举报
回复
试试 handle SIG5 nostop pass
jack_ooneil 2016-03-15
  • 打赏
  • 举报
回复
@r_Jimy 这个帖子我也看到过,但是好像没效果。 Program received signal SIGTRAP, Trace/breakpoint trap. 0x00367793 in _dl_debug_state () from /lib/ld-linux.so.2 (gdb) info registers eax 0x0 0 ecx 0x37363c 3618364 edx 0x3590d4 3510484 ebx 0x372fc0 3616704 esp 0xbfffc060 0xbfffc060 ebp 0xbfffc060 0xbfffc060 esi 0x373650 3618384 edi 0x37363c 3618364 eip 0x367793 0x367793 <_dl_debug_state+3> eflags 0x346 [ PF ZF TF IF ] cs 0x73 115 ss 0x7b 123 ds 0x7b 123 es 0x7b 123 fs 0x0 0 gs 0x0 0 (gdb) set $ps&=~(1<<8) (gdb) info registers eax 0x0 0 ecx 0x37363c 3618364 edx 0x3590d4 3510484 ebx 0x372fc0 3616704 esp 0xbfffc060 0xbfffc060 ebp 0xbfffc060 0xbfffc060 esi 0x373650 3618384 edi 0x37363c 3618364 eip 0x367793 0x367793 <_dl_debug_state+3> eflags 0x246 [ PF ZF IF ] cs 0x73 115 ss 0x7b 123 ds 0x7b 123 es 0x7b 123 fs 0x0 0 gs 0x0 0 (gdb) continue Continuing. Program received signal SIGTRAP, Trace/breakpoint trap. 0x00367793 in _dl_debug_state () from /lib/ld-linux.so.2
常书 2016-03-15
  • 打赏
  • 举报
回复
请参考: http://blog.csdn.net/cjfeii/article/details/21647985

19,622

社区成员

发帖
与我相关
我的任务
社区描述
系统使用、管理、维护问题。可以是Ubuntu, Fedora, Unix等等
社区管理员
  • 系统维护与使用区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧