How do I tell the Xcode debugger to stop only at breakpoints? (not with exceptions)
I am writing a third party plugin for a closed source application. I have a problem with the Xcode debugger.
I would like to use a debugger to execute the plugin code that I am writing. To do this, I set a breakpoint in my code, I started the host application, and then connected the Xcode debugger to the host application process. My problem is that instead of stopping at my breakpoint, the debugger stops instead of an exception thrown by another part of the program. (In particular, it: Thread 2: EXC_ARITHMETIC (code=EXC_i386_DIV, subcode=0x0)
)
This exception is thrown so often that it actually prevents the execution of the code I'm really interested in.
I cannot catch and handle this exception because I do not have source code for the part of the application that is throwing it.
In this situation, can anyone suggest how I can debug my code? Is there a way to tell the Xcode debugger to just "ignore" this particular exception EXC_ARITHMETIC
and instead only stop at the breakpoints I've explicitly set?
UPDATE
@ user1118321 suggested disabling exception breakpoints using the breakpoints bar. I tried to do this using the settings shown here.
I thought that selecting "Auto continue after evaluation" might cause the debugger to stop. This is not true.
I also tried sending cont
to the debugger after stopping. This doesn't work either.
Can you advise me what settings should I put in here to stop the debugger on my exception EXC_ARITHMETIC
?
source to share
I followed the links suggested by @ user1118321. After hours of head scratching, I couldn't figure out how to disable or handle integer division by null exception. If anyone has any ideas I would love to hear them.
However, I found a workaround which is to use GDB instead of XCode. Unlike XCode, GDB doesn't seem to stop at EXC_ARITHMETIC
and allows me to step into my code. So for now I'm going to switch to GDB for debugging.
EDIT
The second (best) workaround, in my case, involved suspending the thread that was throwing the exception. This also allowed me to execute my plugin code.
source to share