2012年10月8日星期一

Getting symbolicate stack call in logs

Getting symbolicate stack call in logs:
In last version of Xcode we can’t see full crash log.
For resolving this issue we can use next solution:

1. add function to your main class
1
2
3
4
5
void uncaughtExceptionHandler(NSException *exception) {

    NSLog(@"CRASH: %@", exception);

    NSLog(@"Stack Trace: %@", [exception callStackSymbols]);

    // Internal error reporting

}
2. And last thing
1
2
3
4
5
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

{  

    NSSetUncaughtExceptionHandler(&uncaughtExceptionHandler);

    // Normal launch stuff

}
Or you can use commands
if you use GDB
1
(gdb) info line *0x2658
or
1
(gdb) bt
And One more Beautiful solution
1. Open the breakpoint navigation in XCode 4 (This looks like a rectangle with a point on the right side)

2. Press the ‘+’ button at the bottom left and add an ‘Exception Breakpoint’. Ensure you break ‘On Throw’ for ‘All’ exceptions.
Now you should get a full backtrace immediately prior to this exception occurring. This should allow you to at least zero in on where this exception is being thrown.
source discussion on stackoverflow one more source
The post Getting symbolicate stack call in logs appeared first on Notes of a Developer.

没有评论:

发表评论