From 85002741a26d6fdf6578e33aaaeace7c04c6254a Mon Sep 17 00:00:00 2001 From: Wesley Wiser Date: Thu, 1 Jul 2021 15:57:12 -0400 Subject: [PATCH] Add visualizer for OsString and fixup other string visualizers --- src/etc/natvis/intrinsic.natvis | 4 ++-- src/etc/natvis/libstd.natvis | 16 +++++++++++++++- src/test/debuginfo/pretty-std.rs | 5 +++-- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/etc/natvis/intrinsic.natvis b/src/etc/natvis/intrinsic.natvis index 52e5d37c83f..558536fa613 100644 --- a/src/etc/natvis/intrinsic.natvis +++ b/src/etc/natvis/intrinsic.natvis @@ -1,8 +1,8 @@ - {data_ptr,[length]s8} - data_ptr,[length]s8 + {(char*)data_ptr,[length]s8} + (char*)data_ptr,[length]s8 length diff --git a/src/etc/natvis/libstd.natvis b/src/etc/natvis/libstd.natvis index 3ccd2e9c30e..25094fc8409 100644 --- a/src/etc/natvis/libstd.natvis +++ b/src/etc/natvis/libstd.natvis @@ -74,7 +74,7 @@ - {inner.data_ptr,s} + {(char*)inner.data_ptr} @@ -101,4 +101,18 @@ + + + {(char*)inner.inner.bytes.buf.ptr.pointer,[inner.inner.bytes.len]} + + + + + inner.inner.bytes.len + (char*)inner.inner.bytes.buf.ptr.pointer + + + + + diff --git a/src/test/debuginfo/pretty-std.rs b/src/test/debuginfo/pretty-std.rs index a2074c43dfa..51325cd4249 100644 --- a/src/test/debuginfo/pretty-std.rs +++ b/src/test/debuginfo/pretty-std.rs @@ -111,8 +111,9 @@ // cdb-check: [11] : 33 '!' [Type: char] // cdb-command: dx os_string -// cdb-check:os_string [Type: [...]::OsString] -// NOTE: OsString doesn't have a .natvis entry yet. +// cdb-check:os_string : "IAMA OS string 😃" [Type: std::ffi::os_str::OsString] +// cdb-check: [] [Type: std::ffi::os_str::OsString] +// cdb-check: [chars] // cdb-command: dx some // cdb-check:some : Some [Type: enum$ >]