开发者

Xcode: GDB and signal handlers

开发者 https://www.devze.com 2023-04-05 06:03 出处:网络
I\'m using signal handlers in an Objective-C application to catch fatal errors, as SIGSEGV, SIGBUS and the like.

I'm using signal handlers in an Objective-C application to catch fatal errors, as SIGSEGV, SIGBUS and the like.

When such an signal is raised, I'm writing a log file, with a backtrace and details about the error (I know I can have reentrancy issues, but that's not the point).

This way, I can know on the next launch that the application has crashed, and I can ask the user if he want to fill a bug report.

It works fine when I launch the app manually.

But when I run it from Xcode (with GDB), the signal handlers are not called.

I've try to set them with signal or sigaction, but there's no difference.

I've also checked with info signals that those signals are开发者_如何学编程 set to pass, meaning they should be passed to the application.

That's not a big deal, as I only got this problem when I'm debugging my application, but it will be very nice to have that working also with GDB.

Has anyone experienced and solved such a problem?


You might want to try to set these signals to nostop in gdb, so it is managed by your application.

0

精彩评论

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

关注公众号