Backed out changeset c10672836664 (bug 1180984)
authorCarsten "Tomcat" Book <>
Wed, 29 Jul 2015 15:26:17 +0200
changeset 286813 90500c5ebface5c24378fcc9ea1d050dcdbd6f1b
parent 286812 40c5f66980a9857223e059c826a1eba50731db33
child 286814 b65c048414f701e3526f13719ca97f15951eeefb
push id5067
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
backs outc106728366642bcfb70f112f50f8630453611d8a
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
Backed out changeset c10672836664 (bug 1180984)
--- a/js/src/gdb/lib-for-tests/
+++ b/js/src/gdb/lib-for-tests/
@@ -10,13 +10,13 @@
 # simple as possible!
 import os
 import sys
 import traceback
     # testlibdir is set on the GDB command line, via:
     # --eval-command python testlibdir=...
-    exec(open(os.path.join(testlibdir, '')).read())
+    execfile(os.path.join(testlibdir, ''))
 except Exception as err:
     sys.stderr.write('Error running GDB prologue:\n')
--- a/js/src/gdb/lib-for-tests/
+++ b/js/src/gdb/lib-for-tests/
@@ -18,19 +18,19 @@ def run_fragment(fragment, function='bre
         assert bp.hit_count == 1
     gdb.execute('frame 1')
 # Assert that |actual| is equal to |expected|; if not, complain in a helpful way.
 def assert_eq(actual, expected):
     if actual != expected:
-        raise AssertionError("""Unexpected result:
+        raise AssertionError, """Unexpected result:
 expected: %r
-actual:   %r""" % (expected, actual))
+actual:   %r""" % (expected, actual)
 # Assert that |value|'s pretty-printed form is |form|. If |value| is a
 # string, then evaluate it with gdb.parse_and_eval to produce a value.
 def assert_pretty(value, form):
     if isinstance(value, str):
         value = gdb.parse_and_eval(value)
     assert_eq(str(value), form)
@@ -39,37 +39,37 @@ def assert_pretty(value, form):
 def assert_subprinter_registered(printer, subprinter):
     # Match a line containing |printer| followed by a colon, and then a
     # series of more-indented lines containing |subprinter|.
     names = { 'printer': re.escape(printer), 'subprinter': re.escape(subprinter) }
     pat = r'^( +)%(printer)s *\n(\1 +.*\n)*\1 +%(subprinter)s *\n' % names
     output = gdb.execute('info pretty-printer', to_string=True)
     if not, output, re.MULTILINE):
-        raise AssertionError("assert_subprinter_registered failed to find pretty-printer:\n"
-                             "  %s:%s\n"
-                             "'info pretty-printer' says:\n"
-                             "%s" % (printer, subprinter, output))
+        raise AssertionError, ("assert_subprinter_registered failed to find pretty-printer:\n"
+                               "  %s:%s\n"
+                               "'info pretty-printer' says:\n"
+                               "%s" % (printer, subprinter, output))
 # Request full stack traces for Python errors.
 gdb.execute('set python print-stack full')
 # Tell GDB not to ask the user about the things we tell it to do.
 gdb.execute('set confirm off', False)
 # Some print settings that make testing easier.
 gdb.execute('set print static-members off')
 gdb.execute('set print address off')
 gdb.execute('set print pretty off')
 gdb.execute('set width 0')
     # testscript is set on the GDB command line, via:
     # --eval-command python testscript=...
-    exec(open(testscript).read())
+    execfile(testscript)
 except AssertionError as err:
     sys.stderr.write('\nAssertion traceback:\n')
     (t, v, tb) = sys.exc_info()
     sys.stderr.write('\nTest assertion failed:\n')
--- a/js/src/gdb/mozilla/
+++ b/js/src/gdb/mozilla/
@@ -13,17 +13,17 @@ UniqueSymbol = 0xffffffff
 class JSSymbolPtr(mozilla.prettyprinters.Pointer):
     def __init__(self, value, cache):
         super(JSSymbolPtr, self).__init__(value, cache)
         self.value = value
     def to_string(self):
-        code = int(self.value['code_']) & 0xffffffff
+        code = int(self.value['code_'])
         desc = str(self.value['description_'])
         if code == InSymbolRegistry:
             return "Symbol.for({})".format(desc)
         elif code == UniqueSymbol:
             return "Symbol({})".format(desc)
             # Well-known symbol. Strip off the quotes added by the JSString *
             # pretty-printer.
--- a/js/src/gdb/mozilla/
+++ b/js/src/gdb/mozilla/
@@ -13,20 +13,16 @@ mozilla.prettyprinters.clear_module_prin
 class Common(object):
     # The name of the template member holding the referent.
     member = 'ptr'
     # If True, this is a handle type, and should be dereferenced. If False,
     # the template member holds the referent directly.
     handle = False
-    # If True, we should strip typedefs from our referent type. (Rooted<T>
-    # uses template magic that gives the referent a noisy type.)
-    strip_typedefs = False
     # Initialize a pretty-printer for |value|, using |cache|.
     # If given, |content_printer| is a pretty-printer constructor to use for
     # this handle/root/etc.'s referent. Usually, we can just omit this argument
     # and let GDB choose a pretty-printer for the referent given its type, but
     # when the referent is a typedef of an integral type (say, |jsid| in a
     # non-|DEBUG| build), the GNU toolchain (at least) loses the typedef name,
     # and all we know about the referent is its fundamental integer type ---
@@ -41,30 +37,28 @@ class Common(object):
     def __init__(self, value, cache, content_printer=None):
         self.value = value
         self.cache = cache
         self.content_printer = content_printer
     def to_string(self):
         ptr = self.value[self.member]
         if self.handle:
             ptr = ptr.dereference()
-        if self.strip_typedefs:
-            ptr = ptr.cast(ptr.type.strip_typedefs())
         if self.content_printer:
             return self.content_printer(ptr, self.cache).to_string()
             # As of 2012-11, GDB suppresses printing pointers in replacement
             # values; see
             # That means that simply returning the 'ptr' member won't work.
             # Instead, just invoke GDB's formatter ourselves.
             return str(ptr)
 class Rooted(Common):
-    strip_typedefs = True
+    pass
 class Handle(Common):
     handle = True
 class MutableHandle(Common):
     handle = True
--- a/js/src/gdb/mozilla/
+++ b/js/src/gdb/mozilla/
@@ -20,17 +20,17 @@ def on_stop(event):
             sigaction_buffers[process] = buf
         # See if AsmJSFaultHandler is installed as the SIGSEGV signal action.
         sigaction_fn = gdb.parse_and_eval('__sigaction')
         sigaction_fn(SIGSEGV, 0, buf)
         AsmJSFaultHandler = gdb.parse_and_eval("AsmJSFaultHandler")
         if buf['__sigaction_handler']['sa_handler'] == AsmJSFaultHandler:
             # Advise the user that magic is happening.
-            print("js/src/gdb/mozilla/ Allowing AsmJSFaultHandler to run.")
+            print "js/src/gdb/mozilla/ Allowing AsmJSFaultHandler to run."
             # If AsmJSFaultHandler doesn't handle this segfault, it will unhook
             # itself and re-raise.
 def on_exited(event):
     if event.inferior in sigaction_buffers:
         del sigaction_buffers[event.inferior]
--- a/js/src/gdb/
+++ b/js/src/gdb/
@@ -156,17 +156,17 @@ class Test(TaskPool.Task):
         return [OPTIONS.gdb_executable,
                 '-nw',          # Don't create a window (unnecessary?)
                 '-nx',          # Don't read .gdbinit.
                 '--ex', 'add-auto-load-safe-path %s' % (OPTIONS.builddir,),
                 '--ex', 'set env LD_LIBRARY_PATH %s' % os.path.join(OPTIONS.objdir, 'js', 'src'),
                 '--ex', 'file %s' % (os.path.join(OPTIONS.builddir, 'gdb-tests'),),
                 '--eval-command', 'python testlibdir=%r' % (testlibdir,),
                 '--eval-command', 'python testscript=%r' % (self.test_path,),
-                '--eval-command', 'python exec(open(%r).read())' % os.path.join(testlibdir, '')]
+                '--eval-command', 'python execfile(%r)' % os.path.join(testlibdir, '')]
     def start(self, pipe, deadline):
         super(Test, self).start(pipe, deadline)
         if OPTIONS.show_cmd:
             self.summary.interleave_output(lambda: self.show_cmd(sys.stdout))
     def onStdout(self, text):
         self.stdout += text