问题
Just recently Xcode 4 has stopped breaking on exceptions. Every exception causes the debugger to stop at UIApplicationMain
with no stack trace.
- I have a breakpoint set on
objc_exception_throw
(confirmed by GDB logs) - Breakpoints are turned on (confirmed by GDB and other breakpoints work fine)
- LLVM GCC 4.2 is my compiler
- Enable Objective-C Exceptions is turned on
Are there any reasons breakpoints may not be working? Any flags I'm missing?
回答1:
In Xcode 4, you add the breakpoint for exceptions via breakpoint tab in the left (hit Apple+6). You add the new exception with the little plus in the bottom left.
See: "Run > Stop on Objective-C exception" in Xcode 4?
For more instructions.
回答2:
It didn't work in XCode 4.2 for me. I solved my issue with specifying a sort of the exception as All C++ exceptions. Debugger is GDB.
来源:https://stackoverflow.com/questions/6285603/why-would-xcode-4-not-be-breaking-on-exceptions