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 127621 f1192bc4c66a576cb1a61d0c3052133d31e55d29
parent 127620 bdba94d329cb294d846ac05a83584206e5f5a955
child 127622 f45f4b3cba11008875d30beb71cd6b5d0e8ca549
child 127624 da9deccb4d5622b8da85878f470aa61249ef3ff0
child 127626 acbe0689b25a1b7fb86bd9dfc8dbe47cd541063d
child 127627 89d8e008eda92cffdcc096007cb157552575e11b
push id1
push usersledru@mozilla.com
push dateThu, 04 Dec 2014 17:57:20 +0000
reviewersted, akeybl
bugs623462
milestone20.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