Bug 1283763 - Fix gdb pretty printers for nsTArray. r?tbsaunde
MozReview-Commit-ID: 6ZirDggUeyD
--- 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