开发者

how to get the thread which asserted in gdb

开发者 https://www.devze.com 2022-12-16 19:59 出处:网络
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

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

精彩评论

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

关注公众号