1

So far I used NSUncaughtExceptionHandler within code:

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

NSUncaughtExceptionHandler *exceptionHandlerPtr = &uncaughtExceptionHandler;

I know that in Xcode I can Add Exception Breakpoint for all exceptions:

enter image description here

Then I can Edit Breakpoint:

enter image description here

and finally I do not know how to configure this to replace my code from NSUncaughtExceptionHandler.

enter image description here

Bartłomiej Semańczyk
  • 59,234
  • 49
  • 233
  • 358

1 Answers1

5

The simplest solution from WWDC 15 - Advanced Debugging and the Address Sanitizer.

enter image description here

Example output is:

enter image description here

You can also read Xcode: One Weird Debugging Trick That Will Save Your Life

Bartłomiej Semańczyk
  • 59,234
  • 49
  • 233
  • 358
  • 2
    I'd also add http://natashatherobot.com/xcode-debugging-trick/ -> comment 1 from Sidney de Koning "And if you ctrl-click on the breakpoint and select 'Move breakpoint to => user', you have it in every project you create :-) Double the awesomeness!" – Nat Jul 17 '15 at 08:50