bug 540627 - provide an environment variable to save minidumps from test runs. r=bsmedberg
--- a/build/automationutils.py
+++ b/build/automationutils.py
@@ -31,17 +31,17 @@
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK ***** */
-import glob, logging, os, subprocess, sys
+import glob, logging, os, shutil, subprocess, sys
import re
__all__ = [
"addCommonOptions",
"checkForCrashes",
"dumpLeakLog",
"processLeakLog",
"getDebuggerInfo",
@@ -113,17 +113,23 @@ def checkForCrashes(dumpDir, symbolsPath
else:
if not symbolsPath:
print "No symbols path given, can't process dump."
if not stackwalkPath:
print "MINIDUMP_STACKWALK not set, can't process dump."
else:
if not os.path.exists(stackwalkPath):
print "MINIDUMP_STACKWALK binary not found: %s" % stackwalkPath
- os.remove(d)
+ dumpSavePath = os.environ.get('MINIDUMP_SAVE_PATH', None)
+ if dumpSavePath:
+ shutil.move(d, dumpSavePath)
+ print "Saved dump as %s" % os.path.join(dumpSavePath,
+ os.path.basename(d))
+ else:
+ os.remove(d)
extra = os.path.splitext(d)[0] + ".extra"
if os.path.exists(extra):
os.remove(extra)
foundCrash = True
return foundCrash
def getFullPath(directory, path):