]> git.lizzy.rs Git - rust.git/commit - src/tools/miri
Rollup merge of #81898 - nanguye2496:nanguye2496/fix_str_and_slice_visualization...
authorDylan DPC <dylan.dpc@gmail.com>
Wed, 17 Feb 2021 22:51:17 +0000 (23:51 +0100)
committerGitHub <noreply@github.com>
Wed, 17 Feb 2021 22:51:17 +0000 (23:51 +0100)
commitf79be2c6de6a2f1b002d3f1f3fd7d9ca2aa8905a
treefd3758275f0cd5f99e0d54dd9190bdc5479cb2b1
parent91e5384fc0d4b7babc360dca12c5a9d88332f13b
parent615fd141bde1e4319f95c3ea2981a1f5a8aa5dbd
Rollup merge of #81898 - nanguye2496:nanguye2496/fix_str_and_slice_visualization, r=varkor

Fix debug information for function arguments of type &str or slice.

Issue details:
When lowering MIR to LLVM IR, the compiler decomposes every &str and slice argument into a data pointer and a usize. Then, the original argument is reconstructed from the pointer and the usize arguments in the body of the function that owns it. Since the original argument is declared in the body of a function, it should be marked as a LocalVariable instead of an ArgumentVairable. This confusion causes MSVC debuggers unable to visualize &str and slice arguments correctly. (See https://github.com/rust-lang/rust/issues/81894 for more details).

Fix details:
Making sure that the debug variable for every &str and slice argument is marked as LocalVariable instead of ArgumentVariable in computing_per_local_var_debug_info. This change has been verified on VS Code debugger, VS debugger, WinDbg and LLDB.