]> git.lizzy.rs Git - rust.git/commit
Fix closed over variables not available in debuginfo for Windows MSVC
authorWesley Wiser <wesleywiser@microsoft.com>
Tue, 6 Apr 2021 17:34:17 +0000 (13:34 -0400)
committerWesley Wiser <wesleywiser@microsoft.com>
Thu, 8 Apr 2021 18:08:56 +0000 (14:08 -0400)
commit533002d3a1f7f95f167323174205b57564b576a6
tree9464f6d5b20dab3db01b9bd190bccae4c61ef733
parente9cdcccfa8321363999a43ee30a18b3aadbc20de
Fix closed over variables not available in debuginfo for Windows MSVC

The issue was that the resulting debuginfo was too complex for LLVM to
translate into CodeView records correctly. As a result, it simply
ignored the debuginfo which meant Windows debuggers could not display
any closed over variables when stepping inside a closure.

This fixes that by spilling additional variables to the stack so that
the resulting debuginfo is simple (just `*my_variable.dbg.spill`) and
LLVM can generate the correct CV records.
compiler/rustc_codegen_ssa/src/mir/debuginfo.rs
compiler/rustc_codegen_ssa/src/mir/place.rs
src/test/debuginfo/var-captured-in-nested-closure.rs
src/test/debuginfo/var-captured-in-stack-closure.rs