about summary refs log tree commit diff
path: root/src/etc/natvis
AgeCommit message (Collapse)AuthorLines
2022-02-03Fix HashMap not displaying correctly in VS debuggerWesley Wiser-1/+1
The natvis to render HashMaps was not working correctly in Visual Studio because the type names for tuples changed from `tuple$<A, B>` to `tuple$<A,B>` (notice the missing space). WinDbg and cdb continued to parse this type name which is why no tests in CI broke. VS however is slightly more strict and this caused the visualizer to break. Since we cannot test the VS debugger in CI, I'm not checking in any test changes.
2021-07-12Add test for `Unique<T>`, weak ref counts and ref counts for `Weak<T>`Wesley Wiser-0/+6
2021-07-09Respond to review feedbackWesley Wiser-2/+5
2021-07-08Add visualizer for OsString and fixup other string visualizersWesley Wiser-3/+17
2021-07-08Add/improve visualizations for liballoc typesWesley Wiser-0/+10
2021-07-08Add natvis for Duration, ManuallyDrop and Pin typesWesley Wiser-0/+22
2021-07-08Add natvis for Range typesWesley Wiser-0/+16
2021-07-08Fixup natvis for NonNull and Unique typesWesley Wiser-13/+6
Remove the Shared type natvis since it no longer exists
2021-07-08Add natvis for cell typesWesley Wiser-0/+34
2021-07-08Add natvis for Atomic typesWesley Wiser-1/+35
2021-07-08Add natvis for NonZero and Wrapping typesWesley Wiser-0/+41
2021-07-02Remove unnecessary visualizerWesley Wiser-8/+0
This isn't used anymore after #85292
2021-07-02Show the variant name for univariant enumsWesley Wiser-2/+16
Previously, only the fields would be displayed with no indication of the variant name. If you already knew the enum was univariant, this was ok but if the enum was univariant because of layout, for example, a `Result<T, !>` then it could be very confusing which variant was the active one.
2021-07-02Always show variant tag in niche-layout enumsWesley Wiser-0/+3
Prior to this, we only showed the `[variant]` synthetic property when the dataful variant is active. With this change, we now always show it so the behavior is consistent.
2021-07-02Update directly tagged enums to visualize the same as niche-layout enumsWesley Wiser-1/+4
Previously, directly tagged enums had a `variant$` field which would show the name of the active variant. We now show the variant using a `[variant]` synthetic item just like we do for niche-layout enums.
2021-06-30Improve debug symbol names to avoid ambiguity and work better with MSVC's ↵Daniel Paoliello-14/+14
debugger There are several cases where names of types and functions in the debug info are either ambiguous, or not helpful, such as including ambiguous placeholders (e.g., `{{impl}}`, `{{closure}}` or `dyn _'`) or dropping qualifications (e.g., for dynamic types). Instead, each debug symbol name should be unique and useful: * Include disambiguators for anonymous `DefPathDataName` (closures and generators), and unify their formatting when used as a path-qualifier vs item being qualified. * Qualify the principal trait for dynamic types. * If there is no principal trait for a dynamic type, emit all other traits instead. * Respect the `qualified` argument when emitting ref and pointer types. * For implementations, emit the disambiguator. * Print const generics when emitting generic parameters or arguments. Additionally, when targeting MSVC, its debugger treats many command arguments as C++ expressions, even when the argument is defined to be a symbol name. As such names in the debug info need to be more C++-like to be parsed correctly: * Avoid characters with special meaning (`#`, `[`, `"`, `+`). * Never start a name with `<` or `{` as this is treated as an operator. * `>>` is always treated as a right-shift, even when parsing generic arguments (so add a space to avoid this). * Emit function declarations using C/C++ style syntax (e.g., leading return type). * Emit arrays as a synthetic `array$<type, size>` type. * Include a `$` in all synthetic types as this is a legal character for C++, but not Rust (thus we avoid collisions with user types).
2021-06-02Respond to review feedbackWesley Wiser-20/+21
2021-06-02Change the type name from `_enum<..>` to `enum$<..>`Wesley Wiser-2/+2
This makes the type name inline with the proposed standard in #85269.
2021-06-02Generate better debuginfo for niche-layout enumsWesley Wiser-0/+14
Previously, we would generate a single struct with the layout of the dataful variant plus an extra field whose name contained the value of the niche (this would only really work for things like `Option<&_>` where we can determine that the `None` case maps to `0` but for enums that have multiple tag only variants, this doesn't work). Now, we generate a union of two structs, one which is the layout of the dataful variant and one which just has a way of reading the discriminant. We also generate an enum which maps the discriminant value to the tag only variants. We also encode information about the range of values which correspond to the dataful variant in the type name and then use natvis to determine which union field we should display to the user. As a result of this change, all niche-layout enums render correctly in WinDbg and Visual Studio!
2021-06-02Generate better debuginfo for directly tagged enumsWesley Wiser-17/+38
2021-03-17Update HashSet natvisMarkus Westerlind-7/+7
2021-03-16feat: Update hashbrown to instantiate less llvm IRMarkus Westerlind-7/+7
Includes https://github.com/rust-lang/hashbrown/pull/204 and https://github.com/rust-lang/hashbrown/pull/205 (not yet merged) which both server to reduce the amount of IR generated for hashmaps. Inspired by the llvm-lines data gathered in https://github.com/rust-lang/rust/pull/76680
2021-03-01Add natvis for Result, NonNull, CString, CStr, and CowRyan Levick-0/+51
2020-12-28Improvements to NatVis supportArlie Davis-39/+59
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.
2020-09-08Implement HashSet in terms of hashbrown::HashSetMatt Brubeck-9/+9
2020-09-05Fix HashMap visualizers in Visual Studio (Code)MaulingMonkey-2/+2
CDB doesn't care that you're using static_cast between unrelated types. VS(C) does. These should've been reinterpret_cast or C casts. Cast is from e.g. `u8*` to `tuple<$T1, $T2>*`
2020-08-07Handle new HashMap layout in CDB, MSVC, WinDbg, etc.MaulingMonkey-31/+4
2020-06-24Modify type names on MSVC to make tuples .natvis compatible.MaulingMonkey-0/+124
- Mangles (T0, T1) as tuple<T0, T1>, possibly unblocking rust-lang/rust#70052 "Update hashbrown to 0.8.0" - Prettifies Rust tuples similar to VS2017's std::tuple - Improves debuginfo test coverage
2019-11-20debuginfo: Support for std::collections::Hash* in windows debuggers.MaulingMonkey-0/+102
2019-05-09Fix .natvis visualizers.MaulingMonkey-10/+10
Updated to handle these changes: - `core::ptr::*` lost their `__0` elements and are just plain pointers - `core::ptr::*` probably shouldn't dereference in `DisplayString` s - `VecDeque` and `Vec` use `core::ptr::*` s - `VecDeque` and `LinkedList` moved modules again. Retested - still working fine, left alone: - `String`, `&str`, `Option`
2017-07-21*.natvis: Use s8 postfixes to correctly interpret rust strings as UTF-8.MaulingMonkey-4/+4
2017-07-13Modify type names on MSVC to make strings and slices .natvis compatible.MaulingMonkey-0/+24
2017-06-13Merge crate `collections` into `alloc`Murarth-7/+7
2017-04-17Remove non-breaking spacesDiggory Blake-4/+4
2017-02-15Vec, LinkedList, VecDeque, String, and Option NatVis visualizationsAndrew Gaspar-0/+95