Bug 1283763 - Fix gdb pretty printers for nsTArray. r=tbsaunde
authorWei-Cheng Pan <wpan@mozilla.com>
Fri, 01 Jul 2016 14:58:49 +0800
changeset 304476 0d73ad04a5366c51a9dd4354d97912ac2a2f9e00
parent 304475 342274a86c0ddbcb0ba6ef462d6f3f78f1a4f3a4
child 304477 0e91dc7e8e439a5c1bb8d5bdddf88e02663216bf
push id30426
push usercbook@mozilla.com
push dateMon, 11 Jul 2016 14:21:30 +0000
treeherdermozilla-central@214884d507ee [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstbsaunde
bugs1283763
milestone50.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 1283763 - Fix gdb pretty printers for nsTArray. r=tbsaunde MozReview-Commit-ID: 6ZirDggUeyD
python/gdbpp/gdbpp/smartptr.py
python/gdbpp/gdbpp/tarray.py
--- a/python/gdbpp/gdbpp/smartptr.py
+++ b/python/gdbpp/gdbpp/smartptr.py
@@ -19,19 +19,19 @@ class weak_ptr_printer(object):
 
         ref_type = proxy.dynamic_type
         weak_ptr = proxy.cast(ref_type).dereference()['mReferent']
         if not weak_ptr:
             return '[(%s) %s]' % (weak_ptr.type, weak_ptr)
 
         return '[(%s) %s]' % (weak_ptr.dynamic_type, weak_ptr)
 
-@GeckoPrettyPrinter('nsAutoPtr', 'nsAutoPtr<.*>')
-@GeckoPrettyPrinter('nsCOMPtr', 'nsCOMPtr<.*>')
-@GeckoPrettyPrinter('RefPtr', 'RefPtr<.*>')
+@GeckoPrettyPrinter('nsAutoPtr', '^nsAutoPtr<.*>$')
+@GeckoPrettyPrinter('nsCOMPtr', '^nsCOMPtr<.*>$')
+@GeckoPrettyPrinter('RefPtr', '^RefPtr<.*>$')
 class smartptr_printer(object):
     def __init__(self, value):
         self.value = value['mRawPtr']
 
     def to_string(self):
         if not self.value:
             type_name = str(self.value.type)
         else:
--- a/python/gdbpp/gdbpp/tarray.py
+++ b/python/gdbpp/gdbpp/tarray.py
@@ -3,17 +3,20 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 import gdb
 import itertools
 from gdbpp import GeckoPrettyPrinter
 
-@GeckoPrettyPrinter('TArray', '.*TArray<.*>$')
+@GeckoPrettyPrinter('InfallibleTArray', '^InfallibleTArray<.*>$')
+@GeckoPrettyPrinter('FallibleTArray', '^FallibleTArray<.*>$')
+@GeckoPrettyPrinter('AutoTArray', '^AutoTArray<.*>$')
+@GeckoPrettyPrinter('nsTArray', '^nsTArray<.*>$')
 class tarray_printer(object):
     def __init__(self, value):
         self.value = value
         self.elem_type = value.type.template_argument(0)
 
     def children(self):
         length = self.value['mHdr'].dereference()['mLength']
         data = self.value['mHdr'] + 1