aboutsummaryrefslogtreecommitdiff
path: root/src/common/mac
diff options
context:
space:
mode:
authorladderbreaker <ladderbreaker@4c0a9323-5329-0410-9bdc-e9ce6186880e>2007-04-11 00:45:00 +0000
committerladderbreaker <ladderbreaker@4c0a9323-5329-0410-9bdc-e9ce6186880e>2007-04-11 00:45:00 +0000
commite9017f323907c5d28ae54f1fe26f73b924fee23c (patch)
tree30f9f33f4c8d9cdafff5bb34b00194030c533ca1 /src/common/mac
parentWrong version of swprintf used with VS 2003/7.1 CRT. r=bryner (diff)
downloadbreakpad-e9017f323907c5d28ae54f1fe26f73b924fee23c.tar.xz
Issue 147 - reviewer Waylonis
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@144 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/common/mac')
-rw-r--r--src/common/mac/dump_syms.mm42
1 files changed, 32 insertions, 10 deletions
diff --git a/src/common/mac/dump_syms.mm b/src/common/mac/dump_syms.mm
index 13368292..6541285e 100644
--- a/src/common/mac/dump_syms.mm
+++ b/src/common/mac/dump_syms.mm
@@ -207,18 +207,40 @@ static BOOL StringTailMatches(NSString *str, NSString *tail) {
[symbols addObject:symbol];
}
- NSArray *converted = [self convertCPlusPlusSymbols:symbols];
- [symbols release];
-
- for (unsigned int i = 0; i < count; ++i) {
- NSMutableDictionary *dict = [addresses_ objectForKey:
- [addresses objectAtIndex:i]];
- NSString *symbol = [converted objectAtIndex:i];
+ // In order to deal with crashing problems in c++filt, we setup
+ // a while loop to handle the case where convertCPlusPlusSymbols
+ // only returns partial results.
+ // We then attempt to continue from the point where c++filt failed
+ // and add the partial results to the total results until we're
+ // completely done.
+
+ unsigned int totalIndex = 0;
+ unsigned int totalCount = count;
+
+ while (totalIndex < totalCount) {
+ NSRange range = NSMakeRange(totalIndex, totalCount - totalIndex);
+ NSArray *subarray = [symbols subarrayWithRange:range];
+ NSArray *converted = [self convertCPlusPlusSymbols:subarray];
+ unsigned int convertedCount = [converted count];
+
+ if (convertedCount == 0) {
+ break; // we give up at this point
+ }
+
+ for (unsigned int convertedIndex = 0;
+ convertedIndex < convertedCount && totalIndex < totalCount;
+ ++totalIndex, ++convertedIndex) {
+ NSMutableDictionary *dict = [addresses_ objectForKey:
+ [addresses objectAtIndex:totalIndex]];
+ NSString *symbol = [converted objectAtIndex:convertedIndex];
- // Only add if this is a non-zero length symbol
- if ([symbol length])
- [dict setObject:symbol forKey:kAddressConvertedSymbolKey];
+ // Only add if this is a non-zero length symbol
+ if ([symbol length])
+ [dict setObject:symbol forKey:kAddressConvertedSymbolKey];
+ }
}
+
+ [symbols release];
}
//=============================================================================