Skip to content

Commit

Permalink
Update natvis to match full type names for Arc, Rc, Weak, etc
Browse files Browse the repository at this point in the history
Also update a test case to have the correct whitespace in a type name.
  • Loading branch information
wesleywiser committed Jul 17, 2023
1 parent fed3c8c commit 12bed9d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions src/etc/natvis/liballoc.natvis
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@
dyn pointees.
Rc<[T]> and Arc<[T]> are handled separately altogether so we can actually show
the slice values.
the slice values. These visualizers have a second wildcard `foo&lt;slice2$&lt;*&gt;, *&gt;`
which accounts for the allocator parameter. This isn't needed for the other visualizers since
their inner `*` eats the type parameter but since the slice ones match part of the type params
it is necessary for them.
-->
<!-- alloc::rc::Rc<T> -->
<Type Name="alloc::rc::Rc&lt;*&gt;">
Expand All @@ -84,7 +87,7 @@
</Type>

<!-- alloc::rc::Rc<[T]> -->
<Type Name="alloc::rc::Rc&lt;slice2$&lt;*&gt; &gt;">
<Type Name="alloc::rc::Rc&lt;slice2$&lt;*&gt;,*&gt;">
<DisplayString>{{ len={ptr.pointer.length} }}</DisplayString>
<Expand>
<Item Name="[Length]" ExcludeView="simple">ptr.pointer.length</Item>
Expand Down Expand Up @@ -114,7 +117,7 @@
</Type>

<!-- alloc::rc::Weak<[T]> -->
<Type Name="alloc::rc::Weak&lt;slice2$&lt;*&gt; &gt;">
<Type Name="alloc::rc::Weak&lt;slice2$&lt;*&gt;,*&gt;">
<DisplayString>{{ len={ptr.pointer.length} }}</DisplayString>
<Expand>
<Item Name="[Length]" ExcludeView="simple">ptr.pointer.length</Item>
Expand Down Expand Up @@ -143,7 +146,7 @@
</Type>

<!-- alloc::sync::Arc<[T]> -->
<Type Name="alloc::sync::Arc&lt;slice2$&lt;*&gt; &gt;">
<Type Name="alloc::sync::Arc&lt;slice2$&lt;*&gt;,*&gt;">
<DisplayString>{{ len={ptr.pointer.length} }}</DisplayString>
<Expand>
<Item Name="[Length]" ExcludeView="simple">ptr.pointer.length</Item>
Expand Down Expand Up @@ -172,7 +175,7 @@
</Type>

<!-- alloc::sync::Weak<[T]> -->
<Type Name="alloc::sync::Weak&lt;slice2$&lt;*&gt; &gt;">
<Type Name="alloc::sync::Weak&lt;slice2$&lt;*&gt;,*&gt;">
<DisplayString>{{ len={ptr.pointer.length} }}</DisplayString>
<Expand>
<Item Name="[Length]" ExcludeView="simple">ptr.pointer.length</Item>
Expand Down
2 changes: 1 addition & 1 deletion tests/debuginfo/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
//
// cdb-command:dx t,d
// cdb-check:t,d : [...] [Type: std::thread::Thread *]
// cdb-check:[...] inner [...][Type: core::pin::Pin<alloc::sync::Arc<std::thread::Inner,alloc::alloc::Global>>]
// cdb-check:[...] inner [...][Type: core::pin::Pin<alloc::sync::Arc<std::thread::Inner,alloc::alloc::Global> >]

use std::thread;

Expand Down

0 comments on commit 12bed9d

Please sign in to comment.