Permalink
Browse files

print atos info message in CDRSymbolicator only if all addresses fail…

…ed symbolication
  • Loading branch information...
1 parent 18e1574 commit 314c4593d7b7e787ce2e476ffda992fa36f165ae @cppforlife cppforlife committed Feb 17, 2013
Showing with 10 additions and 4 deletions.
  1. +10 −4 Source/CDRSymbolicator.m
View
14 Source/CDRSymbolicator.m
@@ -69,17 +69,25 @@ - (void)symbolicateAddresses:(NSArray *)addresses {
atosTask.addresses = validAddresses;
[atosTask launch];
+ BOOL atLeastOneSuccessfulSymbolication = NO;
+
for (int i=0; i<validAddresses.count; i++) {
NSString *fileName = nil;
NSNumber *lineNumber = [NSNumber numberWithInt:0];
[atosTask valuesOnLineNumber:i fileName:&fileName lineNumber:&lineNumber];
if (fileName) {
+ atLeastOneSuccessfulSymbolication = YES;
[self.addresses addObject:[validAddresses objectAtIndex:i]];
[self.fileNames addObject:fileName];
[self.lineNumbers addObject:lineNumber];
}
}
+
+ if (!atLeastOneSuccessfulSymbolication) {
+ printf("atos was not able to symbolicate.\n");
+ printf("Try setting compiler Optimization Level to None (-O0).\n");
+ }
}
+ (NSArray *)validAddresses:(NSArray *)addresses {
@@ -176,9 +184,6 @@ - (void)valuesOnLineNumber:(NSUInteger)line fileName:(NSString **)fileName lineN
encoding:NSUTF8StringEncoding] autorelease];
*lineNumber = [NSNumber numberWithInteger:lineNumberStr.integerValue];
- } else {
- printf("atos was not able to symbolicate '%s'.\n", buf);
- printf("Try setting compiler Optimization Level to None (-O0).\n");
}
free(matches);
}
@@ -192,9 +197,10 @@ + (NSString *)shellOutWithCommand:(NSString *)command arguments:(NSArray *)argum
NSPipe *pipe = [NSPipe pipe];
[task setStandardOutput:pipe];
[task launch];
- [task waitUntilExit];
NSData *data = [[pipe fileHandleForReading] readDataToEndOfFile];
+ [task waitUntilExit];
+
NSString *string = [[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] autorelease];
[task release];

0 comments on commit 314c459

Please sign in to comment.