-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Improvements to NatVis support #80311
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Mark-Simulacrum (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Have you tried to run |
Yes, I've run By the way, I'm working on better support for |
@bors r+ |
📌 Commit 1a30823 has been approved by |
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. * The visualizers for `str` and `String` now place the character data array under a synthetic `[chars]` node. When expanding a `String` node, users rarely want to see an array of characters. This just places them behind one expansion node / level.
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. * The visualizers for `str` and `String` now place the character data array under a synthetic `[chars]` node. When expanding a `String` node, users rarely want to see an array of characters. This just places them behind one expansion node / level.
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. * The visualizers for `str` and `String` now place the character data array under a synthetic `[chars]` node. When expanding a `String` node, users rarely want to see an array of characters. This just places them behind one expansion node / level.
⌛ Testing commit 1a30823 with merge 4e90fe905fd5f202aad0197b01f6c248dc932254... |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Looks like some tests do need an update. In the worst case |
Yeah, I'm updating those tests now. I did run
I've tried using both |
The tests should be run if I did run these tests in the past without any additional setup, but perhaps I had all the necessary components accidentally installed for other reasons. |
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.
Thanks @petrochenkov , that was exactly the issue. I made sure that |
@bors r+ |
📌 Commit 2f58422 has been approved by |
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. * The visualizers for `str` and `String` now place the character data array under a synthetic `[chars]` node. When expanding a `String` node, users rarely want to see an array of characters. This just places them behind one expansion node / level.
Rollup of 7 pull requests Successful merges: - rust-lang#80185 (Fix ICE when pointing at multi bytes character) - rust-lang#80260 (slightly more typed interface to panic implementation) - rust-lang#80311 (Improvements to NatVis support) - rust-lang#80337 (Use `desc` as a doc-comment for queries if there are no doc comments) - rust-lang#80381 (Revert "Cleanup markdown span handling") - rust-lang#80492 (remove empty wraps, don't return Results from from infallible functions) - rust-lang#80509 (where possible, pass slices instead of &Vec or &String (clippy::ptr_arg)) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
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, Weak, and Arc.
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*
andULONG
tounsigned long
.Cosmetic change: Removed {} braces around the visualized display
for
Option
types. They now display simply asSome(value)
orNone
, which reflects what is written in source code.The visualizer for
alloc::string::String
makes assumptions aboutthe layout of
String
(it castsString*
to another type), ratherthan using symbolic expressions. This commit changes the visualizer
so that it simply uses symbolic expressions to access the string
data and string length.
The visualizers for
str
andString
now place the character dataarray under a synthetic
[chars]
node. When expanding aString
node, users rarely want to see an array of characters. This just places
them behind one expansion node / level.