Skip to content

Commit 5d6f0d4

Browse files
committed
look through pointer typedefs
1 parent ccc826c commit 5d6f0d4

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/etc/gdb_providers.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,9 @@ def __init__(self, valobj):
138138
self._valobj = valobj
139139
self._length = int(valobj["len"])
140140
self._data_ptr = unwrap_unique_or_non_null(valobj["buf"]["inner"]["ptr"])
141-
ptr_ty = gdb.Type.pointer(valobj.type.template_argument(0))
142-
self._data_ptr = self._data_ptr.reinterpret_cast(ptr_ty)
141+
self._data_ptr = self._data_ptr.cast(self._data_ptr.type.strip_typedefs())
142+
ptr_ty = valobj.type.template_argument(0).pointer()
143+
self._data_ptr = self._data_ptr.cast(ptr_ty)
143144

144145
def to_string(self):
145146
return "Vec(size={})".format(self._length)
@@ -165,8 +166,9 @@ def __init__(self, valobj):
165166
cap = cap[ZERO_FIELD]
166167
self._cap = int(cap)
167168
self._data_ptr = unwrap_unique_or_non_null(valobj["buf"]["inner"]["ptr"])
168-
ptr_ty = gdb.Type.pointer(valobj.type.template_argument(0))
169-
self._data_ptr = self._data_ptr.reinterpret_cast(ptr_ty)
169+
self._data_ptr = self._data_ptr.cast(self._data_ptr.type.strip_typedefs())
170+
ptr_ty = valobj.type.template_argument(0).pointer()
171+
self._data_ptr = self._data_ptr.cast(ptr_ty)
170172

171173
def to_string(self):
172174
return "VecDeque(size={})".format(self._size)

0 commit comments

Comments
 (0)