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

Unified Diff: chrome/browser/mac/exception_processor.mm

Issue 2561173002: [Mac] Set the nsexception crash key in TERMINATING_FROM_UNCAUGHT_NSEXCEPTION(). (Closed)
Patch Set: '' Created 4 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/mac/exception_processor.mm
diff --git a/chrome/browser/mac/exception_processor.mm b/chrome/browser/mac/exception_processor.mm
index 2b0cf21654cfd045eaa664254a21619e8d925d6c..00f8bb4ed31f43da3cc0f2609cee0a49694abcd1 100644
--- a/chrome/browser/mac/exception_processor.mm
+++ b/chrome/browser/mac/exception_processor.mm
@@ -84,9 +84,12 @@ static const char* const kExceptionSinkholes[] = {
// This function is used to make it clear to the crash processor that this is
// a forced exception crash.
static NOINLINE void TERMINATING_FROM_UNCAUGHT_NSEXCEPTION(id exception) {
- LOG(FATAL) << "Terminating from Objective-C exception: "
- << base::SysNSStringToUTF8([exception name])
- << ": " << base::SysNSStringToUTF8([exception reason]);
+ NSString* exception_message_ns = [NSString
+ stringWithFormat:@"%@: %@", [exception name], [exception reason]];
+ std::string exception_message = base::SysNSStringToUTF8(exception_message_ns);
+ base::debug::SetCrashKeyValue(crash_keys::mac::kNSException,
+ exception_message);
+ LOG(FATAL) << "Terminating from Objective-C exception: " << exception_message;
}
static id ObjcExceptionPreprocessor(id exception) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698