6

I'm not sure what I've done, how long it's been like this (as I've been putting up with it for a while)... but I've lost my stack trace in the debugger in Xcode...sort of. Below is a screen shot of what I see when my app crashes:

enter image description here

And in the console I see this:

enter image description here

So I can figure out what went wrong from the console, but I miss the stack trace that I could click on class files and jump to the source of the crash.

Could it be LLDB? Latest Xcode? Something else swallowing my exceptions? Any ideas?

bandejapaisa
  • 26,576
  • 13
  • 94
  • 112
  • you can check this thread, might be this will help you. I have provided a quick solution there - http://stackoverflow.com/questions/10707453/why-are-my-crash-reports-not-symbolicated/10707555#10707555 – rishi May 23 '12 at 14:21
  • No this doesn't help. That just logs the exception to the console, which I already have. Thanks anyway. – bandejapaisa May 23 '12 at 14:50
  • Could this be `backtrace`?: http://stackoverflow.com/questions/1336469/xcode-global-breakpoints-dont-show-stack-trace – Rok Jarc May 23 '12 at 15:34

1 Answers1

4

The problem is that the debugger isn't stopping when the exception occurs, it is stopping when the program crashes. This happens after the the exception unwinds the stack, which means the source is no longer there. If you want the debugger to stop before the stack is unwound, you need to set a breakpoint when the exception is thrown. Xcode makes this easy. Go to the breakpoints section in the project window.

enter image description here

Then, click the + button in the bottom-left corner and choose "Add Exception Breakpoint…". Make sure that the new breakpoint is set to trigger on throw, or it will still occur after the stack is unwound.

enter image description here

ughoavgfhw
  • 39,734
  • 6
  • 101
  • 123
  • I do use this occasionally, and 'on throw' is the default break point it gives you anyway. It's a very useful tip, which really helps crack some of those nasty ones. I often turn it off because I'm catching some other exceptions and ignoring them (sounds bad, but it's not) - and this breakpoint keeps interrupting my testing. – bandejapaisa May 24 '12 at 18:42