diff options
author | nealsid <nealsid@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2008-06-05 21:20:53 +0000 |
---|---|---|
committer | nealsid <nealsid@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2008-06-05 21:20:53 +0000 |
commit | 38bc56cfa88b16015b4399d3f8a2ac8f768852b6 (patch) | |
tree | 292ef0f74a4ddcc1df66a002a9376f856b30ca21 /src/tools/mac | |
parent | Fix the following bug: (diff) | |
download | breakpad-38bc56cfa88b16015b4399d3f8a2ac8f768852b6.tar.xz |
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
Diffstat (limited to 'src/tools/mac')
-rw-r--r-- | src/tools/mac/symupload/symupload.m | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/tools/mac/symupload/symupload.m b/src/tools/mac/symupload/symupload.m index 70b2ef73..d4a30150 100644 --- a/src/tools/mac/symupload/symupload.m +++ b/src/tools/mac/symupload/symupload.m @@ -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]; |