I'm using Xcode 2.3 on a so-called "BSD C++" app that uses libtiff. Unfortunately, with some badly formatted TIFFs, libtiff crashes. I don't want to fix the particular problem, since it's probably one of many, but instead I want to make my program immune to these crashes so it can just display a message about the bad image and keep running. The bad code in libtiff generates a SIGBUS signal, which I catch and then longjmp from the signal handler. All of this is working perfectly.
Working perfectly when I double-click on the app from the Finder, that is, which is how all my users will launch the app. However, when I run the app from Xcode, either the Debug or Release configurations, instead of the signal being generated and then caught, I go into the Xcode debugger (gdb, actually) with the message 'Program received signal: "EXC_BAD_ACCESS".' in the debug console window. I suppose this is done to help programmers debug, which is fine, but what I want to do is execute my signal-handling code, not stop in the debugger. Continuing from the debugger doesn't do the trick, and I can't find any Xcode or project options to control this behavior.
While I can work this way, it's very inconvenient. I like to click the "Build and Go" button while I'm working.
Is there any way to prevent going into the debugger when running an app from Xcode, so the app executes as though executed from the Finder?
(Note: Please read my question before answering. I'm not asking how to debug libtiff or how to handle a SIGBUS signal.)
Thanks!
--Marc
Start Free Trial