-
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
Stop adding '*' at the end of slice and str typenames for MSVC case #79184
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@@ -94,7 +94,14 @@ pub fn push_debuginfo_type_name<'tcx>( | |||
push_debuginfo_type_name(tcx, inner_type, true, output, visited); | |||
|
|||
if cpp_like_names { | |||
output.push('*'); | |||
// Slices and `&str` are treated like C++ pointers when computing debug |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@varkor : Documentation updated.
@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: ![image](https://user-images.githubusercontent.com/74681961/99594120-9a4dcf80-29a7-11eb-8cce-aedaf1da6d21.png) Debug info in WinDbg after the fix: ![image](https://user-images.githubusercontent.com/74681961/99597173-717c0900-29ac-11eb-861e-98143a9177cf.png) 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.