Bug 1277628 - handle js::GCPtr in gdb pretty-printers; r?sfink draft
authorTom Tromey <tom@tromey.com>
Thu, 02 Jun 2016 12:32:27 -0600
changeset 374520 8d538773fa7afbf5ba75e056601da7adb1ead14b
parent 373936 22047a4eea784c15026c77911c0bd6ea1b70fa68
child 522662 188c045893d589a017fbc5d65f6058a85402e292
push id20053
push userbmo:ttromey@mozilla.com
push dateThu, 02 Jun 2016 18:36:15 +0000
reviewerssfink
bugs1277628
milestone49.0a1
Bug 1277628 - handle js::GCPtr in gdb pretty-printers; r?sfink This avoids an error when trying to deref a GCPtr; and also adds the tag to the NotImplementedError to make it simpler to fix similar bugs in the future. MozReview-Commit-ID: 48JzqqDgNxe
js/src/gdb/mozilla/Root.py
--- a/js/src/gdb/mozilla/Root.py
+++ b/js/src/gdb/mozilla/Root.py
@@ -79,10 +79,12 @@ def deref(root):
     if not tag:
         raise TypeError("Can't dereference type with no structure tag: %s" % (root.type,))
     elif tag.startswith('js::HeapPtr<'):
         return root['value']
     elif tag.startswith('JS::Rooted<'):
         return root['ptr']
     elif tag.startswith('JS::Handle<'):
         return root['ptr']
+    elif tag.startswith('js::GCPtr<'):
+        return root['value']
     else:
-        raise NotImplementedError
+        raise NotImplementedError("Unrecognized tag: " + tag)