Stop adding '*' at the end of slice and str typenames for MSVC case#79184
Conversation
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @varkor (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. |
varkor
left a comment
There was a problem hiding this comment.
Once you've addressed the comments, could you squash your commits? Then this should be good to go.
f7f2575 to
704b455
Compare
…ting debug info for MSVC debuggers
ec75e4c to
36e6aa0
Compare
|
|
||
| if cpp_like_names { | ||
| output.push('*'); | ||
| // Slices and `&str` are treated like C++ pointers when computing debug |
|
@nanguye2496: thanks for the fix! @bors r+ rollup |
|
📌 Commit 36e6aa0 has been approved by |
…nd_str_type_name, r=varkor Stop adding '*' at the end of slice and str typenames for MSVC case When computing debug info for MSVC debuggers, Rust compiler emits C++ style type names for compatibility with .natvis visualizers. All Ref types are treated as equivalences of C++ pointers in this process, and, as a result, their type names end with a '\*'. Since Slice and Str are treated as Ref by the compiler, their type names also end with a '\*'. This causes the .natvis engine for WinDbg fails to display data of Slice and Str objects. We addressed this problem simply by removing the '*' at the end of type names for Slice and Str types. Debug info in WinDbg before the fix:  Debug info in WinDbg after the fix:  This change has also been tested with debuggers for Visual Studio, VS Code C++ and VS Code LLDB to make sure that it does not affect the behavior of other kinds of debugger.
Rollup of 11 pull requests Successful merges: - rust-lang#79038 (Change ui test that are run-pass and that do not test the compiler to library tests) - rust-lang#79184 (Stop adding '*' at the end of slice and str typenames for MSVC case) - rust-lang#79227 (Remove const_fn_feature_flags test) - rust-lang#79444 (Move const ip in ui test to unit test) - rust-lang#79522 (Validate lint docs separately.) - rust-lang#79525 (Add -Z normalize-docs and enable it for compiler docs) - rust-lang#79527 (Move intra-doc link tests into a subdirectory) - rust-lang#79548 (Show since when a function is const in stdlib) - rust-lang#79568 (update Miri) - rust-lang#79573 (Update with status for various NetBSD ports.) - rust-lang#79583 (Update books) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
When computing debug info for MSVC debuggers, Rust compiler emits C++ style type names for compatibility with .natvis visualizers. All Ref types are treated as equivalences of C++ pointers in this process, and, as a result, their type names end with a '*'. Since Slice and Str are treated as Ref by the compiler, their type names also end with a '*'. This causes the .natvis engine for WinDbg fails to display data of Slice and Str objects. We addressed this problem simply by removing the '*' at the end of type names for Slice and Str types.
Debug info in WinDbg before the fix:

Debug info in WinDbg after the fix:

This change has also been tested with debuggers for Visual Studio, VS Code C++ and VS Code LLDB to make sure that it does not affect the behavior of other kinds of debugger.