diff options
| author | Wesley Wiser <wesleywiser@microsoft.com> | 2021-06-30 17:23:44 -0400 |
|---|---|---|
| committer | Wesley Wiser <wesleywiser@microsoft.com> | 2021-07-08 12:55:49 -0400 |
| commit | a6a82c66d4fc3be10861ad6885ff0ab239c203ad (patch) | |
| tree | 3f1b5c2cb417f53a44ce83b1670637f07712890c | |
| parent | 691ee054d5bb8e0a95fd0486a7167bd8889ebba7 (diff) | |
| download | rust-a6a82c66d4fc3be10861ad6885ff0ab239c203ad.tar.gz rust-a6a82c66d4fc3be10861ad6885ff0ab239c203ad.zip | |
Add/improve visualizations for liballoc types
| -rw-r--r-- | src/etc/natvis/liballoc.natvis | 10 | ||||
| -rw-r--r-- | src/test/debuginfo/pretty-std.rs | 26 | ||||
| -rw-r--r-- | src/test/debuginfo/rc_arc.rs | 13 |
3 files changed, 46 insertions, 3 deletions
diff --git a/src/etc/natvis/liballoc.natvis b/src/etc/natvis/liballoc.natvis index 9cc60fc7b47..707643152c9 100644 --- a/src/etc/natvis/liballoc.natvis +++ b/src/etc/natvis/liballoc.natvis @@ -57,16 +57,26 @@ </Synthetic> </Expand> </Type> + <Type Name="alloc::rc::Rc<*>"> <DisplayString>{ptr.pointer->value}</DisplayString> <Expand> <ExpandedItem>ptr.pointer->value</ExpandedItem> + <Item Name="[Reference count]">ptr.pointer->strong</Item> </Expand> </Type> + <Type Name="alloc::rc::Weak<*>"> + <DisplayString>{ptr.pointer->value}</DisplayString> + <Expand> + <ExpandedItem>ptr.pointer->value</ExpandedItem> + </Expand> + </Type> + <Type Name="alloc::sync::Arc<*>"> <DisplayString>{ptr.pointer->data}</DisplayString> <Expand> <ExpandedItem>ptr.pointer->data</ExpandedItem> + <Item Name="[Reference count]">ptr.pointer->strong</Item> </Expand> </Type> <Type Name="alloc::sync::Weak<*>"> diff --git a/src/test/debuginfo/pretty-std.rs b/src/test/debuginfo/pretty-std.rs index 7ed76beb8c6..a2074c43dfa 100644 --- a/src/test/debuginfo/pretty-std.rs +++ b/src/test/debuginfo/pretty-std.rs @@ -129,10 +129,24 @@ // NOTE: cdb fails to interpret debug info of Option enums on i686. // cdb-check:some_string [Type: enum$<core::option::Option<alloc::string::String>, 1, [...], Some>] +// cdb-command: dx linkedlist +// cdb-check:linkedlist : { len=0x2 } [Type: alloc::collections::linked_list::LinkedList<i32>] +// cdb-check: [<Raw View>] [Type: alloc::collections::linked_list::LinkedList<i32>] +// cdb-check: [0x0] : 128 [Type: int] +// cdb-check: [0x1] : 42 [Type: int] + +// cdb-command: dx vecdeque +// cdb-check:vecdeque : { len=0x2 } [Type: alloc::collections::vec_deque::VecDeque<i32>] +// cdb-check: [<Raw View>] [Type: alloc::collections::vec_deque::VecDeque<i32>] +// cdb-check: [len] : 0x2 +// cdb-check: [capacity] : 0x8 [Type: unsigned __int64] +// cdb-check: [0x0] : 90 [Type: int] +// cdb-check: [0x1] : 20 [Type: int] + #![allow(unused_variables)] +use std::collections::{LinkedList, VecDeque}; use std::ffi::OsString; - fn main() { // &[] @@ -156,6 +170,16 @@ fn main() { let some_string = Some("IAMA optional string!".to_owned()); + // LinkedList + let mut linkedlist = LinkedList::new(); + linkedlist.push_back(42); + linkedlist.push_front(128); + + // VecDeque + let mut vecdeque = VecDeque::new(); + vecdeque.push_back(20); + vecdeque.push_front(90); + zzz(); // #break } diff --git a/src/test/debuginfo/rc_arc.rs b/src/test/debuginfo/rc_arc.rs index 6e558bd3c13..24623bc972e 100644 --- a/src/test/debuginfo/rc_arc.rs +++ b/src/test/debuginfo/rc_arc.rs @@ -29,22 +29,31 @@ // cdb-command:dx r,d // cdb-check:r,d : 42 [Type: alloc::rc::Rc<i32>] +// cdb-check: [<Raw View>] [Type: alloc::rc::Rc<i32>] +// cdb-check: [Reference count] : 2 [Type: core::cell::Cell<usize>] // cdb-command:dx r1,d // cdb-check:r1,d : 42 [Type: alloc::rc::Rc<i32>] +// cdb-check: [<Raw View>] [Type: alloc::rc::Rc<i32>] +// cdb-check: [Reference count] : 2 [Type: core::cell::Cell<usize>] // cdb-command:dx w1,d -// cdb-check:w1,d [Type: alloc::rc::Weak<i32>] -// cdb-check: [...] ptr : [...] [Type: core::ptr::non_null::NonNull<alloc::rc::RcBox<i32> >] +// cdb-check:w1,d : 42 [Type: alloc::rc::Weak<i32>] +// cdb-check: [<Raw View>] [Type: alloc::rc::Weak<i32>] // cdb-command:dx a,d // cdb-check:a,d : 42 [Type: alloc::sync::Arc<i32>] +// cdb-check: [<Raw View>] [Type: alloc::sync::Arc<i32>] +// cdb-check: [Reference count] : 2 [Type: core::sync::atomic::AtomicUsize] // cdb-command:dx a1,d // cdb-check:a1,d : 42 [Type: alloc::sync::Arc<i32>] +// cdb-check: [<Raw View>] [Type: alloc::sync::Arc<i32>] +// cdb-check: [Reference count] : 2 [Type: core::sync::atomic::AtomicUsize] // cdb-command:dx w2,d // cdb-check:w2,d : 42 [Type: alloc::sync::Weak<i32>] +// cdb-check: [<Raw View>] [Type: alloc::sync::Weak<i32>] use std::rc::Rc; use std::sync::Arc; |
