Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 5 not printing exception detail

I have a project built for iOS 7 and it worked fine so far, but after a Git merge, some settings or something became corrupted and exceptions are not outputted to console anymore. So the "Terminating app due to uncaught exception" error message is never displayed in console. I've tried the project on both the device and the simulator, same thing. I cannot find the reason why is this and how to fix it and I am humbly asking for your help.

The facts:

  • debugger is working and running,
  • debugger stops and highlights correct line,
  • all exceptions breakpoint is active,
  • NSLog commands are working,
  • po command in lldb is working.

What I have tried before asking for help?

  • Cleaning (including build folder) and rebuilding project,
  • Restarting Xcode,
  • Restarting OS X,
  • Reconnecting device,
  • Rebooting device.

What else can I do? Thank you for your help!

like image 573
Legoless Avatar asked Oct 15 '13 08:10

Legoless


1 Answers

I ran into this issue when trying to debug an autolayout crash. Not sure if this applies to all cases, but here's my solution:

I did some hunting, and came across this link:

Investigating NSExceptions with LLDB

That led me to mess around with exception breakpoints to try to figure out what the issue was. In my case, I could always find the description on $eax, so I decided to add an action to the breakpoint, so I don't have to debug it each time. This caused it to always print $eax without a breakpoint, so it pretty much acts like I want it to (print the exception description, continue crashing).

Steps:

Add an Exception Breakpoint

Edit the breakpoint you just added

Add an action to <code>po $eax</code>, and check "automatically continue after evaluating"

Solved the issue I was currently having, and I'm sure variations on this solution (po $ebx, po [NSThread callStackSymbols], etc) should get around most issues with missing exception descriptions.

like image 69
Jesse Avatar answered Nov 06 '22 03:11

Jesse