Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- signal(SIGBUS, signalHandler);
- signal(SIGSEGV, signalHandler);
- void signalHandler(int signal)
- {
- NSMutableString *crashReport = [[NSMutableString alloc] init];
- void* callstack[128];
- int i, frames = backtrace(callstack, 128);
- char** strs = backtrace_symbols(callstack, frames);
- for (i = 0; i < frames; ++i) {
- //printf("%sn", strs[i]);
- [crashReport appendFormat:@"%sn",strs[i]];
- }
- free(strs);
- // write crashReport to file
- [crashReport release];
- exit(1);
- }
Add Comment
Please, Sign In to add comment