]> git.lizzy.rs Git - rust.git/commit
Improvements to NatVis support
authorArlie Davis <ardavis@microsoft.com>
Tue, 22 Dec 2020 22:02:07 +0000 (14:02 -0800)
committerArlie Davis <ardavis@microsoft.com>
Mon, 28 Dec 2020 20:14:49 +0000 (12:14 -0800)
commit2f584229d4e9dab4f1eb4cb548756b708619ae15
tree512994b990243058f2c3f034a2e0a5ef8a4de6a0
parent2987785df3d46d5ff144a5c67fbb8f5cca798d78
Improvements to NatVis support

NatVis files describe how to display types in some Windows debuggers,
such as Visual Studio, WinDbg, and VS Code.

This commit makes several improvements:

* Adds visualizers for Rc<T>, Weak<T>, and Arc<T>.

* Changes [size] to [len], for consistency with the Rust API.
  Visualizers often use [size] to mirror the size() method on C++ STL
  collections.

* Several visualizers used the PVOID and ULONG typedefs. These are part
  of the Windows API; they are not guaranteed to always be defined in a
  pure Rust DLL/EXE. I converted PVOID to `void*` and `ULONG` to
  `unsigned long`.

* Cosmetic change: Removed {} braces around the visualized display
  for `Option` types. They now display simply as `Some(value)` or
  `None`, which reflects what is written in source code.

* The visualizer for `alloc::string::String` makes assumptions about
  the layout of `String` (it casts `String*` to another type), rather
  than using symbolic expressions. This commit changes the visualizer
  so that it simply uses symbolic expressions to access the string
  data and string length.
src/etc/natvis/intrinsic.natvis
src/etc/natvis/liballoc.natvis
src/etc/natvis/libcore.natvis
src/etc/natvis/libstd.natvis
src/test/debuginfo/pretty-std-collections-hash.rs
src/test/debuginfo/pretty-std.rs