Bug 1283763 - Fix gdb pretty printers for nsTArray. r?tbsaunde draft
authorWei-Cheng Pan <wpan@mozilla.com>
Fri, 01 Jul 2016 14:58:49 +0800
changeset 385003 eabf0569fc20bb0d71ace7a7e9f7d0f4c3824ff6
parent 385002 4764b9f8e6d4ef9823237f01ca3901759ce8daeb
child 524810 7eeed12f14108da162906515908dadcd3231e601
push id22385
push userbmo:wpan@mozilla.com
push dateThu, 07 Jul 2016 12:18:17 +0000
reviewerstbsaunde
bugs1283763
milestone50.0a1
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