Authored by 孟顺

crash 异常传递代码添加

review by 枪兵
... ... @@ -17,6 +17,8 @@
#pragma mark - C Fuctions
static NSUncaughtExceptionHandler *YH_CrashReporter_Exception_Handler = NULL;
@interface YH_CrashReporter()
- (NSString *)callstackString;
... ... @@ -72,6 +74,9 @@ void yh_uncaughtCrashExceptionHandler(NSException *exception)
kYHEventReportTimeElapsed : currentTimestamp()?:@""
};
[crash performSelectorOnMainThread:@selector(handleNSException:) withObject:userInfo waitUntilDone:YES];
if (YH_CrashReporter_Exception_Handler != NULL) {
YH_CrashReporter_Exception_Handler(exception);
}
}
@implementation YH_CrashReporter
... ... @@ -99,7 +104,7 @@ void yh_uncaughtCrashExceptionHandler(NSException *exception)
signal(SIGILL, yh_sighandler);
signal(SIGPIPE, yh_sighandler);
signal(SIGSEGV, yh_sighandler);
YH_CrashReporter_Exception_Handler = NSGetUncaughtExceptionHandler();
NSSetUncaughtExceptionHandler(&yh_uncaughtCrashExceptionHandler);
}
... ...