开发者

How to debug SIGTRAP using gdb?

My own program uses SIGTRAP signal. I want to use gdb to debug my program. However, when the SIGTRAP is raised in my program, gdb cannot go in开发者_运维百科to my trap handler.

How to single step into my trap handler?


I am not sure if it will work for you, but try to use sigaction to turn off your signal handler (within your signal handler), and than raise SIGTRAP again.

That should raise the signal to the OS, which will call the debugger (hopefully). afterwards use sigaction again to register you own handler.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜