Legoless
Legoless

Reputation: 11112

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:

What I have tried before asking for help?

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

Upvotes: 8

Views: 1664

Answers (1)

Jesse
Jesse

Reputation: 10466

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.

Upvotes: 5

Related Questions