Skip to content

Commit 6e562d2

Browse files
committed
fix behavior
1 parent b95f6f2 commit 6e562d2

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/etc/gdb_rust_pretty_printing.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -308,21 +308,20 @@ def __init__(self, val):
308308

309309
@staticmethod
310310
def display_hint():
311-
return "map"
311+
return "array"
312312

313313
def to_string(self):
314314
(length, data_ptr) = \
315315
rustpp.extract_length_and_ptr_from_std_btreeset(self.__val)
316316
return (self.__val.type.get_unqualified_type_name() +
317-
(" with %i elements" % length))
317+
("(len: %i)" % length))
318318

319319
def children(self):
320320
(length, data_ptr) = \
321321
rustpp.extract_length_and_ptr_from_std_btreeset(self.__val)
322322
val = GdbValue(data_ptr.get_wrapped_value().dereference()).get_child_at_index(3)
323323
gdb_ptr = val.get_wrapped_value()
324324
for index in xrange(length):
325-
yield (str(index), str(index))
326325
yield (str(index), gdb_ptr[index])
327326

328327

src/test/debuginfo/pretty-std-collections.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
// gdb-command: run
2121

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

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

0 commit comments

Comments
 (0)