Skip to content

Add or improve natvis definitions for common standard library types #86983

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jul 16, 2021
Merged
19 changes: 6 additions & 13 deletions src/etc/natvis/libcore.natvis
Original file line number Diff line number Diff line change
Expand Up @@ -75,24 +75,17 @@
<DisplayString>{__0}</DisplayString>
</Type>

<Type Name="core::ptr::Unique&lt;*&gt;">
<DisplayString>{{ Unique {pointer} }}</DisplayString>
<Expand>
<Item Name="[ptr]">pointer</Item>
</Expand>
</Type>

<Type Name="core::ptr::Shared&lt;*&gt;">
<DisplayString>{{ Shared {pointer} }}</DisplayString>
<Type Name="core::ptr::non_null::NonNull&lt;*&gt;">
<DisplayString>NonNull({(void*) pointer}: {pointer})</DisplayString>
<Expand>
<Item Name="[ptr]">pointer</Item>
<ExpandedItem>pointer</ExpandedItem>
</Expand>
</Type>

<Type Name="core::ptr::non_null::NonNull&lt;*&gt;">
<DisplayString>{(void*) pointer}</DisplayString>
<Type Name="core::ptr::unique::Unique&lt;*&gt;">
<DisplayString>Unique({(void*)pointer}: {pointer})</DisplayString>
<Expand>
<Item Name="[value]">*pointer</Item>
<ExpandedItem>pointer</ExpandedItem>
</Expand>
</Type>

Expand Down
21 changes: 21 additions & 0 deletions src/test/debuginfo/marker-types.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// only-cdb
// compile-flags:-g

// === CDB TESTS ==================================================================================

// cdb-command: g

// cdb-command: dx nonnull
// cdb-check:nonnull : NonNull(0x[...]: 0xc) [Type: core::ptr::non_null::NonNull<u32>]
// cdb-check: [<Raw View>] [Type: core::ptr::non_null::NonNull<u32>]
// cdb-checK: 0xc [Type: unsigned int]

use std::ptr::NonNull;

fn main() {
let nonnull: NonNull<_> = (&12u32).into();

zzz(); // #break
}

fn zzz() { }