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

Unified Diff: components/crash/app/breakpad_linux.cc

Issue 1019663003: Roll breakpad r1454:r1456 and add product info in microdumps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« 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: components/crash/app/breakpad_linux.cc
diff --git a/components/crash/app/breakpad_linux.cc b/components/crash/app/breakpad_linux.cc
index 03ce34b1089d0baf441b940ed65a8212ee20b7d6..702d0b48ee50438898dad8a51e652b22817a8776 100644
--- a/components/crash/app/breakpad_linux.cc
+++ b/components/crash/app/breakpad_linux.cc
@@ -89,6 +89,12 @@ char* g_crash_log_path = NULL;
ExceptionHandler* g_breakpad = NULL;
ExceptionHandler* g_microdump = NULL;
+std::string g_microdump_build_fingerprint;
Lei Zhang 2015/05/14 19:14:26 Mark these Android only?
Lei Zhang 2015/05/14 19:14:27 Won't this and |g_microdump_product_info| add stat
Primiano Tucci (use gerrit) 2015/05/15 10:20:28 Facepalm, right. switched to lazy_instance with no
Primiano Tucci (use gerrit) 2015/05/15 10:20:28 Done.
+const char* g_c_microdump_build_fingerprint = NULL;
Lei Zhang 2015/05/14 19:14:27 Let's start using nullptr in new code.
Primiano Tucci (use gerrit) 2015/05/15 10:20:27 If you are fine with that, I did mass s/NULL/nullp
+
+std::string g_microdump_product_info;
+const char* g_c_microdump_product_info = NULL;
+
#if defined(ADDRESS_SANITIZER)
const char* g_asan_report_str = NULL;
#endif
@@ -729,10 +735,29 @@ void InitMicrodumpCrashHandlerIfNecessary(const std::string& process_type) {
VLOG(1) << "Enabling microdumps crash handler (process_type:"
<< process_type << ")";
+
+ const char* product_name = NULL;
+ const char* product_version = NULL;
+ GetCrashReporterClient()->GetProductNameAndVersion(&product_name,
+ &product_version);
+ g_microdump_product_info = product_name + string(":") + product_version;
+ g_microdump_build_fingerprint =
+ base::android::BuildInfo::GetInstance()->android_build_fp();
+
+ // The exception handler runs in a compromised context and cannot use c_str()
+ // as that would require the heap. Therefore, we have to guarantee that the
+ // build fingerprint and product info pointers are always valid.
+ g_c_microdump_product_info = g_microdump_product_info.c_str();
+ g_c_microdump_build_fingerprint = g_microdump_build_fingerprint.c_str();
+
+ MinidumpDescriptor descriptor(MinidumpDescriptor::kMicrodumpOnConsole);
+ descriptor.SetMicrodumpProductInfo(g_c_microdump_product_info);
+ descriptor.SetMicrodumpBuildFingerprint(g_c_microdump_build_fingerprint);
+
DCHECK(!g_microdump);
bool is_browser_process = process_type.empty() || process_type == "webview";
g_microdump = new ExceptionHandler(
- MinidumpDescriptor(MinidumpDescriptor::kMicrodumpOnConsole),
+ descriptor,
NULL,
MicrodumpCrashDone,
reinterpret_cast<void*>(is_browser_process),
« 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