Bug 1062689 - Run local mochitest and reftest output through fix_macosx_stack.py on Mac. r=ted.
authorNicholas Nethercote <nnethercote@mozilla.com>
Thu, 04 Sep 2014 22:19:42 -0700
changeset 227235 5e6dbf2fd6bb8da95f984e42867f9a4907fe9d3d
parent 227234 e67894f694493eb987775b4ec3dc9c592355d895
child 227236 e3bf97aef43d985234c908cd903a65810f8632cf
push id4187
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:29:12 +0000
treeherdermozilla-beta@f23cc6a30c11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs1062689
milestone35.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1062689 - Run local mochitest and reftest output through fix_macosx_stack.py on Mac. r=ted.
build/automation.py.in
testing/mochitest/runtests.py
tools/rb/fix_macosx_stack.py
--- a/build/automation.py.in
+++ b/build/automation.py.in
@@ -679,17 +679,17 @@ class Automation(object):
 
       if self.IS_DEBUG_BUILD and symbolsPath and os.path.exists(symbolsPath):
         # Run each line through a function in fix_stack_using_bpsyms.py (uses breakpad symbol files)
         # This method is preferred for Tinderbox builds, since native symbols may have been stripped.
         sys.path.insert(0, utilityPath)
         import fix_stack_using_bpsyms as stackFixerModule
         stackFixerFunction = lambda line: stackFixerModule.fixSymbols(line, symbolsPath)
         del sys.path[0]
-      elif self.IS_DEBUG_BUILD and self.IS_MAC and False:
+      elif self.IS_DEBUG_BUILD and self.IS_MAC:
         # Run each line through a function in fix_macosx_stack.py (uses atos)
         sys.path.insert(0, utilityPath)
         import fix_macosx_stack as stackFixerModule
         stackFixerFunction = lambda line: stackFixerModule.fixSymbols(line)
         del sys.path[0]
       elif self.IS_DEBUG_BUILD and self.IS_LINUX:
         # Run each line through a function in fix_linux_stack.py (uses addr2line)
         # This method is preferred for developer machines, so we don't have to run "make buildsymbols".
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -1903,16 +1903,22 @@ class Mochitest(MochitestUtilsMixin):
         return module
 
       if self.symbolsPath and os.path.exists(self.symbolsPath):
         # Run each line through a function in fix_stack_using_bpsyms.py (uses breakpad symbol files).
         # This method is preferred for Tinderbox builds, since native symbols may have been stripped.
         stackFixerModule = import_stackFixerModule('fix_stack_using_bpsyms')
         stackFixerFunction = lambda line: stackFixerModule.fixSymbols(line, self.symbolsPath)
 
+      elif mozinfo.isMac:
+        # Run each line through fix_macosx_stack.py (uses atos).
+        # This method is preferred for developer machines, so we don't have to run "make buildsymbols".
+        stackFixerModule = import_stackFixerModule('fix_macosx_stack')
+        stackFixerFunction = lambda line: stackFixerModule.fixSymbols(line)
+
       elif mozinfo.isLinux:
         # Run each line through fix_linux_stack.py (uses addr2line).
         # This method is preferred for developer machines, so we don't have to run "make buildsymbols".
         stackFixerModule = import_stackFixerModule('fix_linux_stack')
         stackFixerFunction = lambda line: stackFixerModule.fixSymbols(line)
 
       return stackFixerFunction
 
--- a/tools/rb/fix_macosx_stack.py
+++ b/tools/rb/fix_macosx_stack.py
@@ -127,17 +127,18 @@ def fixSymbols(line):
                 # up the remaining cases(!), which will begin with '_Z'.
                 if (name.startswith("_Z")):
                     name = cxxfilt(name)
                 info = "%s (%s, in %s)" % (name, fileline, library)
 
             # throw away the bad symbol, but keep balance tree structure
             before = balance_tree_re.match(before).groups()[0]
 
-            return before + info + after + "\n"
+            nl = '\n' if line[-1] == '\n' else ''
+            return before + info + after + nl
         else:
             sys.stderr.write("Warning: File \"" + file + "\" does not exist.\n")
             return line
     else:
         return line
 
 if __name__ == "__main__":
     for line in sys.stdin: