about summary refs log tree commit diff
path: root/src/etc/natvis
AgeCommit message (Collapse)AuthorLines
2025-04-17Update libcore.natvis for Pin.Mara Bos-2/+2
2024-10-11rename RcBox in other places tooJonathan Dönszelmann-1/+1
2024-08-11Fix debuginfo providers/testsBen Kimock-12/+12
2024-07-09Add Natvis visualiser and debuginfo tests for `f16`beetrees-0/+26
2024-03-14Try fixing `debuginfo` test.Markus Reiter-1/+4
2024-01-27Update tests.Markus Reiter-34/+1
2024-01-16Rename `pointer` field on `Pin`LegionMammal978-2/+2
The internal, unstable field of `Pin` can conflict with fields from the inner type accessed via the `Deref` impl. Rename it from `pointer` to `__pointer`, to make it less likely to conflict with anything else.
2023-12-19update natvis to match changed RawVec structureThe 8472-4/+4
2023-07-17Update natvis to match full type names for Arc, Rc, Weak, etcWesley Wiser-5/+8
Also update a test case to have the correct whitespace in a type name.
2022-11-27Fix natvis `VecDeque` formatterMarkus Everling-8/+7
2022-10-31[debuginfo] Make debuginfo type names for slices and str consistent.Michael Woerister-6/+14
Before this PR, the compiler would emit the debuginfo name `slice$<T>` for all kinds of slices, regardless of whether they are behind a reference or not and regardless of the kind of reference. As a consequence, the types `Foo<&[T]>`, `Foo<[T]>`, and `Foo<&mut [T]>` would end up with the same type name `Foo<slice$<T> >` in debuginfo, making it impossible to disambiguate between them by name. Similarly, `&str` would get the name `str` in debuginfo, so the debuginfo name for `Foo<str>` and `Foo<&str>` would be the same. In contrast, `*const [bool]` and `*mut [bool]` would be `ptr_const$<slice$<bool> >` and `ptr_mut$<slice$<bool> >`, i.e. the encoding does not lose information about the type. This PR removes all special handling for slices and `str`. The types `&[bool]`, `&mut [bool]`, and `&str` thus get the names `ref$<slice2$<bool> >`, `ref_mut$<slice2$<bool> >`, and `ref$<str$>` respectively -- as one would expect.
2022-09-28Add a niche to `Duration`, unix `SystemTime`, and non-apple `Instant`beetrees-2/+2
2022-08-12[debuginfo] Remove the notion of a 'fallback variant' from the CPP-like enum ↵Michael Woerister-10/+66
debuginfo encoding.
2022-08-12intrinsic.natvis: Add comments, make names more consistent.Michael Woerister-44/+48
2022-08-12intrinsic.natvis: Don't access fields from context object in <Intrinsic>.Michael Woerister-36/+41
WinDbg supports that but Visual Studio doesn't. Pass the value as a parameter instead.
2022-08-12Remove out-dated NatVis visualizer.Michael Woerister-8/+0
2022-08-12Support wrapping 128-bit tag ranges for cpp-like enum debuginfo.Michael Woerister-2/+4
2022-08-12Use enum2<_> instead of enum<_> for Cpp-like debuginfo enum type names.Michael Woerister-2/+2
And add more comments about niche tag enum encoding.
2022-08-12debuginfo: Change C++-like encoding for enums.Michael Woerister-67/+113
The updated encoding should be able to handle niche layouts where more than one variant has fields.
2022-06-15debuginfo: Fix NatVis for Rc and Arc with unsized pointees.Michael Woerister-16/+110
2022-05-16Read the Ref/RefMut pointer in natvisJosh Stone-4/+4
2022-04-14Update *.natvis files (CDB?) files to take into account `Unique<T>` changesEduardo Sánchez Muñoz-10/+10
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