summaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authorjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-05 23:14:24 +0000
committerjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-05 23:14:24 +0000
commit0007358a9616389d5551a6d110e1145d6e57a884 (patch)
tree3f645df2930360f32258cfb57d4db24ecf3b72e2 /components
parentfb28ad1f2e04da8dfc03eb1e97de079c457ecc63 (diff)
downloadchromium_src-0007358a9616389d5551a6d110e1145d6e57a884.zip
chromium_src-0007358a9616389d5551a6d110e1145d6e57a884.tar.gz
chromium_src-0007358a9616389d5551a6d110e1145d6e57a884.tar.bz2
Include the pid in the common crash keys
This makes it easier to locate a minidump corresponding to a given crash when running layout tests BUG=none R=rsesek@chromium.org Review URL: https://codereview.chromium.org/55903006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@233129 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components')
-rw-r--r--components/breakpad/app/breakpad_linux.cc6
-rw-r--r--components/breakpad/app/breakpad_mac.mm4
-rw-r--r--components/breakpad/app/breakpad_win.cc5
3 files changed, 11 insertions, 4 deletions
diff --git a/components/breakpad/app/breakpad_linux.cc b/components/breakpad/app/breakpad_linux.cc
index 01bfcdd..740213b 100644
--- a/components/breakpad/app/breakpad_linux.cc
+++ b/components/breakpad/app/breakpad_linux.cc
@@ -82,6 +82,7 @@ const char kUploadURL[] = "https://clients2.google.com/cr/report";
bool g_is_crash_reporter_enabled = false;
uint64_t g_process_start_time = 0;
+pid_t g_pid = 0;
char* g_crash_log_path = NULL;
ExceptionHandler* g_breakpad = NULL;
@@ -590,7 +591,7 @@ bool CrashDone(const MinidumpDescriptor& minidump,
info.upload = upload;
info.process_start_time = g_process_start_time;
info.oom_size = base::g_oom_size;
- info.pid = 0;
+ info.pid = g_pid;
info.crash_keys = g_crash_keys;
HandleCrashDump(info);
#if defined(OS_ANDROID)
@@ -698,6 +699,7 @@ bool CrashDoneInProcessNoUpload(
info.distro_length = distro_length;
info.upload = false;
info.process_start_time = g_process_start_time;
+ info.pid = g_pid;
info.crash_keys = g_crash_keys;
HandleCrashDump(info);
return FinalizeCrashDoneAndroid();
@@ -723,6 +725,7 @@ void EnableNonBrowserCrashDumping(int minidump_fd) {
return;
}
SetProcessStartTime();
+ g_pid = getpid();
g_is_crash_reporter_enabled = true;
// Save the process type (it is leaked).
@@ -1477,6 +1480,7 @@ void InitCrashReporter() {
}
SetProcessStartTime();
+ g_pid = getpid();
GetBreakpadClient()->SetDumpWithoutCrashingFunction(&DumpProcess);
#if defined(ADDRESS_SANITIZER)
diff --git a/components/breakpad/app/breakpad_mac.mm b/components/breakpad/app/breakpad_mac.mm
index 56a4ded..6cdd33d 100644
--- a/components/breakpad/app/breakpad_mac.mm
+++ b/components/breakpad/app/breakpad_mac.mm
@@ -274,6 +274,10 @@ void InitCrashProcessInfo() {
// Store process type in crash dump.
SetCrashKeyValue(@"ptype", process_type);
+
+ NSString* pid_value =
+ [NSString stringWithFormat:@"%d", static_cast<unsigned int>(getpid())];
+ SetCrashKeyValue(@"pid", pid_value);
}
} // namespace breakpad
diff --git a/components/breakpad/app/breakpad_win.cc b/components/breakpad/app/breakpad_win.cc
index e2fca70..29e442e 100644
--- a/components/breakpad/app/breakpad_win.cc
+++ b/components/breakpad/app/breakpad_win.cc
@@ -44,9 +44,6 @@
namespace breakpad {
-// TODO(raymes): Modify the way custom crash info is stored. g_custom_entries
-// is way too too fragile. See
-// https://code.google.com/p/chromium/issues/detail?id=137062.
std::vector<google_breakpad::CustomInfoEntry>* g_custom_entries = NULL;
bool g_deferred_crash_uploads = false;
@@ -277,6 +274,8 @@ google_breakpad::CustomClientInfo* GetCustomInfo(const std::wstring& exe_path,
g_custom_entries->push_back(
google_breakpad::CustomInfoEntry(L"ptype", type.c_str()));
g_custom_entries->push_back(google_breakpad::CustomInfoEntry(
+ L"pid", base::StringPrintf(L"%d", ::GetCurrentProcessId()).c_str()));
+ g_custom_entries->push_back(google_breakpad::CustomInfoEntry(
L"channel", base::UTF16ToWide(channel_name).c_str()));
g_custom_entries->push_back(google_breakpad::CustomInfoEntry(
L"profile-type", GetProfileType().c_str()));