Skip to content

Commit

Permalink
Fix GDB pretty-printer for tuples
Browse files Browse the repository at this point in the history
Names of children should not be the same,
because GDB uses them to distinguish the children.
  • Loading branch information
gentoo90 committed May 28, 2017
1 parent 5d2512e commit ac33d2c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/etc/gdb_rust_pretty_printing.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,10 @@ def children(self):
cs = []
wrapped_value = self.__val.get_wrapped_value()

for field in self.__val.type.get_fields():
for number, field in enumerate(self.__val.type.get_fields()):
field_value = wrapped_value[field.name]
if self.__is_tuple_like:
cs.append(("", field_value))
cs.append((str(number), field_value))
else:
cs.append((field.name, field_value))

Expand Down

0 comments on commit ac33d2c

Please sign in to comment.