Bug 1031558 - JS GDB pretty-printers: fix symbol jsids. r=jimb.
authorJason Orendorff <jorendorff@mozilla.com>
Fri, 27 Jun 2014 17:04:19 -0500
changeset 195109 94b2e3eda6f079e17fbf260c02d45a1020574dda
parent 195108 bf628f6b830cc4fe0fbe859c67b683fb9e95aa52
child 195110 4c5ee514a3ac192913db91e945682f66e6eb0990
push id46515
push userjorendorff@mozilla.com
push dateSun, 20 Jul 2014 04:11:54 +0000
treeherdermozilla-inbound@b5b6b138a900 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimb
bugs1031558
milestone33.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 1031558 - JS GDB pretty-printers: fix symbol jsids. r=jimb.
js/src/gdb/mozilla/jsid.py
--- a/js/src/gdb/mozilla/jsid.py
+++ b/js/src/gdb/mozilla/jsid.py
@@ -13,17 +13,17 @@ mozilla.prettyprinters.clear_module_prin
 class jsid(object):
     # Since people don't always build with macro debugging info, I can't
     # think of any way to avoid copying these values here, short of using
     # inferior calls for every operation (which, I hear, is broken from
     # pretty-printers in some recent GDBs).
     TYPE_STRING                 = 0x0
     TYPE_INT                    = 0x1
     TYPE_VOID                   = 0x2
-    TYPE_OBJECT                 = 0x4
+    TYPE_SYMBOL                 = 0x4
     TYPE_MASK                   = 0x7
 
     def __init__(self, value, cache):
         self.value = value
         self.cache = cache
         self.concrete_type = self.value.type.strip_typedefs()
 
     # SpiderMonkey has two alternative definitions of jsid: a typedef for
@@ -42,19 +42,21 @@ class jsid(object):
         bits = self.as_bits()
         tag = bits & jsid.TYPE_MASK
         if tag == jsid.TYPE_STRING:
             body = bits.cast(self.cache.JSString_ptr_t)
         elif tag & jsid.TYPE_INT:
             body = bits >> 1
         elif tag == jsid.TYPE_VOID:
             return "JSID_VOID"
-        elif tag == jsid.TYPE_OBJECT:
+        elif tag == jsid.TYPE_SYMBOL:
+            if bits == jsid.TYPE_SYMBOL:
+                return "JSID_EMPTY"
             body = ((bits & ~jsid.TYPE_MASK)
-                    .cast(self.cache.JSObject_ptr_t))
+                    .cast(self.cache.JSSymbol_ptr_t))
         else:
             body = "<unrecognized>"
         return '$jsid(%s)' % (body,)
 
 # Hard-code the referent type pretty-printer for jsid roots and handles.
 # See the comment for mozilla.Root.Common.__init__.
 @pretty_printer('JS::Rooted<long>')
 def RootedJSID(value, cache):