Bug 623462 - Add an environment variable to save a full dump, not just a minidump, r=ted a=akeybl
authorBenjamin Smedberg <benjamin@smedbergs.us>
Tue, 26 Feb 2013 14:03:26 -0500
changeset 123495 3198ee9d24e1430fd49bdbdf64e24d16cc356062
parent 123494 15d443143008465ee67ce1cf4dd515523c3b81d6
child 123496 668544a286c115e54d5ba14f55dbf8ab540b9eda
child 123498 64badb13daf751ff89f00962612d039a5198e171
push id281
push userbsmedberg@mozilla.com
push dateTue, 26 Feb 2013 19:57:56 +0000
treeherdermozilla-release@3198ee9d24e1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted, akeybl
bugs623462
milestone19.0
Bug 623462 - Add an environment variable to save a full dump, not just a minidump, r=ted a=akeybl
toolkit/crashreporter/nsExceptionHandler.cpp
--- a/toolkit/crashreporter/nsExceptionHandler.cpp
+++ b/toolkit/crashreporter/nsExceptionHandler.cpp
@@ -757,17 +757,26 @@ static bool FPEFilter(void* context, EXC
 }
 #endif // XP_WIN
 
 static bool ShouldReport()
 {
   // this environment variable prevents us from launching
   // the crash reporter client
   const char *envvar = PR_GetEnv("MOZ_CRASHREPORTER_NO_REPORT");
-  return !(envvar && *envvar);
+  if (envvar && *envvar) {
+    return false;
+  }
+
+  envvar = PR_GetEnv("MOZ_CRASHREPORTER_FULLDUMP");
+  if (envvar && *envvar) {
+    return false;
+  }
+
+  return true;
 }
 
 namespace {
   bool Filter(void* context) {
     mozilla::DisableWritePoisoning();
     return true;
   }
 }
@@ -927,16 +936,21 @@ nsresult SetExceptionHandler(nsIFile* aX
            minor = LOWORD(file_info->dwFileVersionMS),
            revision = HIWORD(file_info->dwFileVersionLS);
       if (major > 6 || (major == 6 && minor > 1) ||
           (major == 6 && minor == 1 && revision >= 7600)) {
         minidump_type = MiniDumpWithFullMemoryInfo;
       }
     }
   }
+
+  const char* e = PR_GetEnv("MOZ_CRASHREPORTER_FULLDUMP");
+  if (e && *e) {
+    minidump_type = MiniDumpWithFullMemory;
+  }
 #endif // XP_WIN32
 
 #ifdef MOZ_WIDGET_ANDROID
   androidUserSerial = getenv("MOZ_ANDROID_USER_SERIAL_NUMBER");
 #endif
 
   // now set the exception handler
 #ifdef XP_LINUX