about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-04-08 23:09:06 +0000
committerbors <bors@rust-lang.org>2021-04-08 23:09:06 +0000
commit619d19c3181e4793de789302d60a0343f0081139 (patch)
tree1847b21594093408df688dab8de6c79f6e2c2bb1 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parent2e495d2e845cf27740e3665f718acfd3aa17253e (diff)
parent533002d3a1f7f95f167323174205b57564b576a6 (diff)
downloadrust-619d19c3181e4793de789302d60a0343f0081139.tar.gz
rust-619d19c3181e4793de789302d60a0343f0081139.zip
Auto merge of #83941 - wesleywiser:win_dbginfo_closures, r=nagisa
Improve debuginfo for closures and async functions on 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 or async fn.

This fixes that by creating additional allocas on the stack so that
the resulting debuginfo is simple (just `*my_variable.dbg.spill`) and
LLVM can generate the correct CV records.

I also updated some of our existing tests to run in CDB to cover this case.

Before (closure):

![image](https://user-images.githubusercontent.com/831192/113756857-e6dc4200-96df-11eb-8d6d-b7ed7a84aad5.png)

After (closure):

![image](https://user-images.githubusercontent.com/831192/113757067-2e62ce00-96e0-11eb-89f7-7dc8ab89b1b8.png)

Before (async):

![image](https://user-images.githubusercontent.com/831192/114077916-4e2bfa80-9876-11eb-9f15-e302d1faa652.png)

After (async):

![image](https://user-images.githubusercontent.com/831192/114077677-0d33e600-9876-11eb-8ce3-cac20a9ea94a.png)

Fixes #83709
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions