Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(565)

Unified Diff: chrome/common/mac/objc_zombie.mm

Issue 10408004: [Mac] Log stack trace for CHECK in bug 97285. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/common/mac/objc_zombie.mm
diff --git a/chrome/common/mac/objc_zombie.mm b/chrome/common/mac/objc_zombie.mm
index e5d3a82c0b0d75a5bfa9bad047bfd5ea536a3c36..5ef00a67cf9bb43092f7402b409e72109a9946fb 100644
--- a/chrome/common/mac/objc_zombie.mm
+++ b/chrome/common/mac/objc_zombie.mm
@@ -290,21 +290,11 @@ void ZombieObjectCrash(id object, SEL aSelector, SEL viaSelector) {
// Set a value for breakpad to report.
base::mac::SetCrashKeyValue(@"zombie", aString);
- // Hex-encode the backtrace and tuck it into a breakpad key.
- NSString* deallocTrace = @"<unknown>";
- if (found && record.traceDepth) {
- NSMutableArray* hexBacktrace =
- [NSMutableArray arrayWithCapacity:record.traceDepth];
- for (size_t i = 0; i < record.traceDepth; ++i) {
- NSString* s = [NSString stringWithFormat:@"%p", record.trace[i]];
- [hexBacktrace addObject:s];
- }
- deallocTrace = [hexBacktrace componentsJoinedByString:@" "];
-
- // Warn someone if this exceeds the breakpad limits.
- DCHECK_LE(strlen([deallocTrace UTF8String]), 255U);
+ // Encode trace into a breakpad key.
+ if (found) {
+ base::mac::SetCrashKeyFromAddresses(
+ @"zombie_dealloc_bt", record.trace, record.traceDepth);
}
- base::mac::SetCrashKeyValue(@"zombie_dealloc_bt", deallocTrace);
// Log -dealloc backtrace in debug builds then crash with a useful
// stack trace.

Powered by Google App Engine
This is Rietveld 408576698