Skip to content

Commit

Permalink
fix behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
fukatani committed Aug 13, 2018
1 parent b95f6f2 commit 6e562d2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/etc/gdb_rust_pretty_printing.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,21 +308,20 @@ def __init__(self, val):

@staticmethod
def display_hint():
return "map"
return "array"

def to_string(self):
(length, data_ptr) = \
rustpp.extract_length_and_ptr_from_std_btreeset(self.__val)
return (self.__val.type.get_unqualified_type_name() +
(" with %i elements" % length))
("(len: %i)" % length))

def children(self):
(length, data_ptr) = \
rustpp.extract_length_and_ptr_from_std_btreeset(self.__val)
val = GdbValue(data_ptr.get_wrapped_value().dereference()).get_child_at_index(3)
gdb_ptr = val.get_wrapped_value()
for index in xrange(length):
yield (str(index), str(index))
yield (str(index), gdb_ptr[index])


Expand Down
2 changes: 1 addition & 1 deletion src/test/debuginfo/pretty-std-collections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// gdb-command: run

// gdb-command: print btree_set
// gdb-check:$1 = BTreeSet<i32> with 3 elements = {[0] = 3, [1] = 5, [2] = 7}
// gdb-check:$1 = BTreeSet<i32>(len: 3) = {3, 5, 7}

// gdb-command: print vec_deque
// gdb-check:$2 = VecDeque<i32>(len: 3, cap: 8) = {5, 3, 7}
Expand Down

0 comments on commit 6e562d2

Please sign in to comment.