bug 1297723 - support mozilla::UniquePtr in the gdb pretty printers r=froydnj
authorTrevor Saunders <tbsaunde@tbsaunde.org>
Wed, 24 Aug 2016 11:27:04 -0400
changeset 348440 cc389e9b7883531b91dc9885f1261737c3c0f4bc
parent 348439 494b13143c3eb904f2c42300d0b43bbc486c5f2d
child 348441 1d0b02250149cabcb1ed3244fa03842c90483d3a
push id10298
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:33:03 +0000
treeherdermozilla-aurora@7e29173b1641 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1297723
milestone52.0a1
bug 1297723 - support mozilla::UniquePtr in the gdb pretty printers r=froydnj
python/gdbpp/gdbpp/smartptr.py
--- a/python/gdbpp/gdbpp/smartptr.py
+++ b/python/gdbpp/gdbpp/smartptr.py
@@ -35,8 +35,21 @@ class smartptr_printer(object):
 
     def to_string(self):
         if not self.value:
             type_name = str(self.value.type)
         else:
             type_name = str(self.value.dereference().dynamic_type.pointer())
 
         return '[(%s) %s]' % (type_name, str(self.value))
+
+@GeckoPrettyPrinter('UniquePtr', '^mozilla::UniquePtr<.*>$')
+class uniqueptr_printer(object):
+    def __init__(self, value):
+        self.value = value['mTuple']['mFirstA']
+
+    def to_string(self):
+        if not self.value:
+            type_name = str(self.value.type)
+        else:
+            type_name = str(self.value.dereference().dynamic_type.pointer())
+
+        return '[(%s) %s]' % (type_name, str(self.value))