gdb不停收到sigtrap信号
2014-03-20 21:33
134 查看
在用gdb调试程序的时候出现这样一种错误:
Program received signal SIGTRAP, Trace/breakpoint trap.
在网上查到解决方案了,在这mark一下,以后有时间好好研究。
Program received signal SIGTRAP, Trace/breakpoint trap.
在网上查到解决方案了,在这mark一下,以后有时间好好研究。
找到解决问题的办法了 在kernel mode改写了watchpoint的值以后,cpu把eflags的TF位置1了,照理说gdb应该清0这一位,但由于未知原因,gdb没清0该位, (gdb) info registers eax 0x1 1 ecx 0xbfa4fc93 -1079706477 edx 0x1 1 ebx 0x0 0 esp 0xbfa4fc64 0xbfa4fc64 ebp 0xbfa4fc98 0xbfa4fc98 esi 0x92dca0 9624736 edi 0x0 0 eip 0x978402 0x978402 <__kernel_vsyscall+2> eflags 0x200346 [ PF ZF TF IF ID ] cs 0x73 115 ss 0x7b 123 ds 0x7b 123 es 0x7b 123 fs 0x0 0 gs 0x33 51 (gdb) 只需手动清楚该位即可: (gdb) set $ps&=~(1<<8) 【on x86-based machines $ps is an alias for the eflags register,TF is the 9th bit of eflags】 (gdb) info registers eax 0x1 1 ecx 0xbf90f353 -1081019565 edx 0x1 1 ebx 0x0 0 esp 0xbf90f324 0xbf90f324 ebp 0xbf90f358 0xbf90f358 esi 0x92dca0 9624736 edi 0x0 0 eip 0xe66402 0xe66402 <__kernel_vsyscall+2> eflags 0x200246 [ PF ZF IF ID ] cs 0x73 115 ss 0x7b 123 ds 0x7b 123 es 0x7b 123 fs 0x0 0 gs 0x33 51 (gdb) 再continue,gdb就不会不停收到SIGTRAP了
相关文章推荐
- gdb不停收到sigtrap信号
- gdb时发出SIGTRAP信号的处理
- TRAP 收到信号后不立即执行的问题
- 使用gdb调试网络程序时,收到SIGPIPE信号异常退出问题
- GDB在调试运行过程中会由于收到信号而停止
- gdb启动时,进程收到中断信号造成无法正常启动的解决办法
- gdb 收到SIGPIPE信号
- sigprocmask和信号阻塞
- 在qt程序中捕捉linux信号,sigint sighup sigterm
- gdb调试时忽略信号中断
- 4.1.3.2 master_sigsetup函数:信号处理程序初始化
- gdb中忽略信号处理
- volatile关键字与竞态条件和sigchild信号
- gdb 调试的时候被信号终止
- gdb控制/屏蔽信号
- 关于Linux Shell的信号trap功能你必须知道的细节
- 常用命令:如何使用命令trap来捕捉信号
- linux信号(sigprocmask,sigpending)
- caffe之路-SIGTERM信号捕捉
- Linux 信号处理,是否同一个线程组的线程收到SIGSEGV其它线程都会被挂起