Modified symupload to correctly handle spaces in module names when processing symbol file

Reviewer=mmentovai



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@279 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
nealsid 2008-06-05 21:20:53 +00:00
parent cc6cd1ff37
commit 38bc56cfa8

View File

@ -56,10 +56,25 @@ static NSArray *ModuleDataForSymbolFile(NSString *file) {
NSString *str = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
NSScanner *scanner = [NSScanner scannerWithString:str];
NSString *line;
NSArray *parts = nil;
NSMutableArray *parts = nil;
const int MODULE_ID_INDEX = 3;
if ([scanner scanUpToString:@"\n" intoString:&line]) {
parts = [[NSMutableArray alloc] init];
NSScanner *moduleInfoScanner = [NSScanner scannerWithString:line];
NSString *moduleInfo;
// Get everything BEFORE the module name. None of these properties
// can have spaces.
for (int i = 0; i <= MODULE_ID_INDEX; i++) {
[moduleInfoScanner scanUpToString:@" " intoString:&moduleInfo];
[parts addObject:moduleInfo];
}
if ([scanner scanUpToString:@"\n" intoString:&line])
parts = [line componentsSeparatedByString:@" "];
// Now get the module name. This can have a space so we scan to
// the end of the line.
[moduleInfoScanner scanUpToString:@"\n" intoString:&moduleInfo];
[parts addObject:moduleInfo];
}
[str release];