3

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?

kubi
  • 48,104
  • 19
  • 94
  • 118
  • 2
    have you tried turning breakpoints on and off? I had that problem a few times in XCode3. Just switch them off, run app, then turn on again and it worked. – Nick Weaver Jun 08 '11 at 21:45
  • If that doesn't work, perhaps an upgrade to the latest XCode might fix it. No guarantee but I'd expect there to be a lot of bug fixes in it. :-) – drekka Jun 08 '11 at 23:47
  • @Derek This issue did cause me to upgrade from 4.0.1 to 4.0.2, but that didn't fix it. @Nick I've tried restarting Xcode and switching breakpoints on and off. *Mysterious* – kubi Jun 09 '11 at 00:10
  • Same thing happening to me (in 4.0.2), and Cmd+6 shows "All Objective-C Exceptions" is there and enabled. Switching breakpoints off/on doesn't help (plus other breakpoints do work - just not the Obj-C ones). Innnnteresting. – Joe D'Andrea Jul 19 '11 at 20:43
  • This thread may be relevant:http://stackoverflow.com/questions/8100054/no-exception-stack-trace-in-console-under-xcode-4-2-ios-5 – Hot Licks Apr 25 '12 at 21:59

2 Answers2

3

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.

Community
  • 1
  • 1
rich.e
  • 3,660
  • 4
  • 28
  • 44
1

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.

spkps
  • 53
  • 1
  • 6