7

Ref: Xcode/LLDB: How to get information about an exception that was just thrown?

So I can get the exception by typing po *(id *)($ebp + 8) in debugger console, and there is an option in the breakpoint to print something when the breakpoint is met, but that option can only print the address of the object but not the description of it. The option about debugger command even print nothing by po.

Is there any setting to print the description of the exception automatically?

Community
  • 1
  • 1
Kay Chan
  • 345
  • 1
  • 3
  • 11
  • See this question: http://stackoverflow.com/questions/8100054/no-exception-stack-trace-in-console-under-xcode-4-2-ios-5 – Hot Licks Dec 06 '14 at 20:37

1 Answers1

2

I use such solution to print issues in debug builds and run:

void uncaughtExceptionHandler(NSException *exception)
{
    NSLog(@"CRASH: %@", exception);
    NSLog(@"Stack Trace: %@", [exception callStackSymbols]);
}

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
#if DEBUG
    NSSetUncaughtExceptionHandler(&uncaughtExceptionHandler);
#endif
    return YES;
}
Vitalii Gozhenko
  • 9,220
  • 2
  • 48
  • 66
  • It work for all my projects. In your case, maybe some framework override exception handler? If you use Crashlytics/Testflight/Google Analytics, you need put your own exception handler in the end, to be sure... – Vitalii Gozhenko Dec 06 '14 at 20:41