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?
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;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With