How to replace NSUncaughtExceptionHandler with definition in Breakpoint navigator?

做~自己de王妃 提交于 2019-11-30 16:18:57

问题


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:

Then I can Edit Breakpoint:

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


回答1:


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

Example output is:

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



来源:https://stackoverflow.com/questions/31471312/how-to-replace-nsuncaughtexceptionhandler-with-definition-in-breakpoint-navigato

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!