开发者

how to get the thread which asserted in gdb

When some assert() fails, gdb breaks but doesn't show the aborting thread. In case of a signal (like a segfault), it works fine. Is there an easy way to know what threads has just a开发者_C百科borted?

Esp., I am using Xcode here.


You can write your own assert marco which sends SIGSEGV instead of SIGABRT.

#define assert(check) do { if(!(check)) kill (getpid(), SIGSEGV); } while(0)
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜