Files
rust/tests/debuginfo
bors 6474e99989 Auto merge of #162598 - Walnut356:msvc_scopes, r=jieyouxu
Fix the remaining `tests/debuginfo` failures on `msvc` 



Fixes the remainder of the failing tests from https://github.com/rust-lang/rust/issues/161657

I used lldb 22.1 to individually check each of the `S_DEFRANGE_REGISTER_REL_INDIR` node (using e.g. `llvm-pdbutil dump --symbols ".\build\x86_64-pc-windows-gnu\test\debuginfo\<test_name>.lldb\a.pdb" | rg "unknown \(4471\)"`)

Any tests with an `unknown (4471)` node (4471/0x1177 being the enum value for `S_DEFRANGE_REGISTER_REL_INDIR`) got an `[msvc]` revision to disable on LLDB older than 23.1.0.

I then updated to LLDB 23.1.0 and disabled any remaining test failures that ocurred due to the variable shadowing behavior (so that they do not instantly break when we eventually run 23 in CI). Technically we could have avoided disabling those tests by using the python API to inspect individual slots of the frame, or by printing the whole frame at each step and matching against that, but the amount of effort seems not worth it until [we determine whether or not LLDB can/will improve its behavior here.](https://github.com/llvm/llvm-project/issues/221696).

One note, LLDB 23 seems to like it even less when we use the parent debugger instance for the test harness. I'll fix that in a followup PR since it requires a little bit of fiddling to get it to work with LLDB <23 (the short version is it's much harder to exit with a non-0 status code when using a nested debugger instance. We should be able to run something like `os.kill(os.getpid(), signal.SIGTERM)` from the internal python to kill the parent LLDB process to work around that)

There were a few fixes that required special handling

### `borrowed-basic.rs`, `basic-types-globals.rs`, `reference-debuginfo.rs` 

LLDB appears to have changed their default formatting for chars again in v23.1.0 (`U+0x00000061 U'a'` -> `U+0061 U'a'`) luckily these are similar enough that we can use a wildcard to pass in both cases


### `dummy-span.rs`

There was a conditional to prevent using the (0,0) default dummy span on MSVC with a comment explaining why (it would default to the first line of the file instead). I removed the `is_msvc` check and this test worked and didn't break anything else so, best guess this got fixed at some point and the comment was outdated?

In any case, with this PR, the entirety of `tests/debuginfo` passes on `linux-gnu`, `windows-gnu`, and `windows-msvc` 🎉🎉

<img width="847" height="444" alt="image" src="https://github.com/user-attachments/assets/4c0f14d1-5ad4-4234-8380-59ad18ad6309" />


<img width="817" height="208" alt="image" src="https://github.com/user-attachments/assets/87819fcd-cdbb-4fd4-b2f8-c6cf2ecf5db3" />


r? @Kobzol, @jieyouxu
2026-09-13 03:03:32 +00:00
..
2026-08-23 00:57:14 -05:00
2026-09-11 17:08:12 +02:00
2026-04-02 09:44:38 -05:00
2026-06-01 00:57:56 -05:00
2025-11-29 15:59:11 +01:00
2026-04-02 09:44:38 -05:00
2026-09-07 04:08:12 -05:00
2026-06-01 00:57:56 -05:00