How to automatically print an exception in xcode?

Link: Xcode / LLDB: how to get information about an exception that was just thrown?

Therefore, I can get an exception by typing po *(id *)($ebp + 8) in the debugger console, and at the breakpoint there is an option to print when the breakpoint is executed, but this option can print only the address of the object, but not the description from this. The debugger command option does not even print anything po .

Is there any option to automatically print an exception description?

+6
source share
1 answer

I use this solution to print problems 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; } 
0
source

Source: https://habr.com/ru/post/908485/


All Articles