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 128459 3ceece2977374967d43def41e57152a38b3e6897
parent 128458 a9ce9efea742529d44f64cc6d3061daabf862c13
child 128460 2d230ceff8fcb309009b59f477617996def39393
push id3420
push userryanvm@gmail.com
push dateTue, 26 Feb 2013 22:12:44 +0000
treeherdermozilla-aurora@2d230ceff8fc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted, akeybl
bugs623462
milestone21.0a2
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