Skip to content

Commit ac33d2c

Browse files
committed
Fix GDB pretty-printer for tuples
Names of children should not be the same, because GDB uses them to distinguish the children.
1 parent 5d2512e commit ac33d2c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/etc/gdb_rust_pretty_printing.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,10 @@ def children(self):
186186
cs = []
187187
wrapped_value = self.__val.get_wrapped_value()
188188

189-
for field in self.__val.type.get_fields():
189+
for number, field in enumerate(self.__val.type.get_fields()):
190190
field_value = wrapped_value[field.name]
191191
if self.__is_tuple_like:
192-
cs.append(("", field_value))
192+
cs.append((str(number), field_value))
193193
else:
194194
cs.append((field.name, field_value))
195195

0 commit comments

Comments
 (0)