fix behavior

This commit is contained in:
Unknown 2018-08-13 23:01:48 +09:00
parent b95f6f2e8f
commit 6e562d24c6
2 changed files with 3 additions and 4 deletions

View File

@ -308,13 +308,13 @@ class RustStdBTreeSetPrinter(object):
@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) = \
@ -322,7 +322,6 @@ class RustStdBTreeSetPrinter(object):
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])

View File

@ -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}