about summary refs log tree commit diff
path: root/src/test/debuginfo
diff options
context:
space:
mode:
authorPietro Albini <pietro@pietroalbini.org>2018-11-25 17:05:04 +0100
committerGitHub <noreply@github.com>2018-11-25 17:05:04 +0100
commited6c7b751dd427d6b10825c9d6bbcca08e769fa9 (patch)
treeedb071d761f94eaa2f7f95942b978cd99e7d362b /src/test/debuginfo
parent6398df1520638c68bb75daa33d64c75387c26b1f (diff)
parentd4ee1c93ff25a7fa6f5e35dc774a648a7e6d578e (diff)
Rollup merge of #56144 - tromey:Bug-55771-btreemap, r=alexcrichton
Fix BTreeSet and BTreeMap gdb pretty-printers

The BTreeSet and BTreeMap gdb pretty-printers did not take the node
structure into account, and consequently only worked for shallow sets.
This fixes the problem by iterating over child nodes when needed.

This patch avoids the current approach of implementing some of the
value manipulations in debugger-indepdendent code.  This was done for
convenience: a type lookup was needed for the first time, and there
currently are no lldb formatters for these types.

Closes #55771
Diffstat (limited to 'src/test/debuginfo')
-rw-r--r--src/test/debuginfo/pretty-std-collections.rs17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/test/debuginfo/pretty-std-collections.rs b/src/test/debuginfo/pretty-std-collections.rs
index 0d3f4b90f23..a51be370aa4 100644
--- a/src/test/debuginfo/pretty-std-collections.rs
+++ b/src/test/debuginfo/pretty-std-collections.rs
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-tidy-linelength
 // ignore-windows failing on win32 bot
 // ignore-freebsd: gdb package too new
 // ignore-android: FIXME(#10381)
@@ -20,10 +21,10 @@
 // gdb-command: run
 
 // gdb-command: print btree_set
-// gdb-check:$1 = BTreeSet<i32>(len: 3) = {3, 5, 7}
+// gdb-check:$1 = BTreeSet<i32>(len: 15) = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}
 
 // gdb-command: print btree_map
-// gdb-check:$2 = BTreeMap<i32, i32>(len: 3) = {[3] = 3, [5] = 7, [7] = 4}
+// gdb-check:$2 = BTreeMap<i32, i32>(len: 15) = {[0] = 0, [1] = 1, [2] = 2, [3] = 3, [4] = 4, [5] = 5, [6] = 6, [7] = 7, [8] = 8, [9] = 9, [10] = 10, [11] = 11, [12] = 12, [13] = 13, [14] = 14}
 
 // gdb-command: print vec_deque
 // gdb-check:$3 = VecDeque<i32>(len: 3, cap: 8) = {5, 3, 7}
@@ -41,15 +42,15 @@ fn main() {
 
     // BTreeSet
     let mut btree_set = BTreeSet::new();
-    btree_set.insert(5);
-    btree_set.insert(3);
-    btree_set.insert(7);
+    for i in 0..15 {
+        btree_set.insert(i);
+    }
 
     // BTreeMap
     let mut btree_map = BTreeMap::new();
-    btree_map.insert(5, 7);
-    btree_map.insert(3, 3);
-    btree_map.insert(7, 4);
+    for i in 0..15 {
+        btree_map.insert(i, i);
+    }
 
     // VecDeque
     let mut vec_deque = VecDeque::new();