Skip to content

Fix the remaining tests/debuginfo failures on msvc - #162598

Merged
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
Walnut356:msvc_scopes
Sep 13, 2026
Merged

rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
Walnut356:msvc_scopes

Conversation

@Walnut356

Copy link
Copy Markdown
Contributor

Fixes the remainder of the failing tests from #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..

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 🎉🎉

image image

r? @Kobzol, @jieyouxu

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 10, 2026
@rustbot

rustbot commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Kobzol is not on the review rotation at the moment.
They may take a while to respond.

@Walnut356

Walnut356 commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor Author

I guess i should also note, 23 support is not something i'm actively pursuing atm, the 23-based fixes are just to make sure we dont leave things that we know will break relatively soon.

@jieyouxu jieyouxu self-assigned this Sep 10, 2026
Comment thread compiler/rustc_codegen_llvm/src/debuginfo/mod.rs

@jieyouxu jieyouxu left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I also ran this locally.
@bors r+ rollup=never note="adjust dummy span debuginfo handling"

View changes since this review

@rust-bors

rust-bors Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 52a6da2 has been approved by jieyouxu

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 12, 2026
@jhpratt

jhpratt commented Sep 13, 2026

Copy link
Copy Markdown
Member

@bors p=6 scheduling

@rust-bors

This comment has been minimized.

@rust-bors rust-bors Bot added merged-by-bors This PR was explicitly merged by bors. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 13, 2026
@rust-bors

rust-bors Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

☀️ Test successful - CI
Approved by: jieyouxu
Duration: 2h 50m 59s
Pushing 6474e99 to main...

@rust-bors
rust-bors Bot merged commit 6474e99 into rust-lang:main Sep 13, 2026
14 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Sep 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor
What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 67e8d9d (parent) -> 6474e99 (this PR)

Test differences

Show 547 test diffs

Stage 1

  • [debuginfo-cdb] tests/debuginfo/by-value-self-argument-in-trait-impl.rs#msvc: [missing] -> ignore (cdb is not available) (J0)
  • [debuginfo-cdb] tests/debuginfo/captured-fields-2.rs: ignore (cdb is not available) -> [missing] (J0)
  • [debuginfo-cdb] tests/debuginfo/shadowed-argument.rs#msvc: [missing] -> ignore (cdb is not available) (J0)
  • [debuginfo-cdb] tests/debuginfo/simple-lexical-scope.rs: ignore (cdb is not available) -> [missing] (J0)
  • [debuginfo-cdb] tests/debuginfo/var-captured-in-nested-closure.rs: ignore (cdb is not available) -> [missing] (J0)
  • [debuginfo-cdb] tests/debuginfo/var-captured-in-sendable-closure.rs#msvc: [missing] -> ignore (cdb is not available) (J0)
  • [debuginfo-gdb] tests/debuginfo/issue-22656.rs#msvc: [missing] -> ignore (debugger is gdb) (J0)
  • [debuginfo-gdb] tests/debuginfo/issue-22656.rs#non-msvc: [missing] -> ignore (debugger is gdb) (J0)
  • [debuginfo-gdb] tests/debuginfo/lexical-scope-in-for-loop.rs#msvc: [missing] -> ignore (only executed when the target environment is msvc) (J0)
  • [debuginfo-gdb] tests/debuginfo/lexical-scope-in-while.rs#msvc: [missing] -> ignore (only executed when the target environment is msvc) (J0)
  • [debuginfo-gdb] tests/debuginfo/shadowed-variable.rs: pass -> [missing] (J0)
  • [debuginfo-gdb] tests/debuginfo/simple-lexical-scope.rs: pass -> [missing] (J0)
  • [debuginfo-gdb] tests/debuginfo/var-captured-in-sendable-closure.rs: pass -> [missing] (J0)
  • [debuginfo-lldb] tests/debuginfo/issue-22656.rs: ignore (lldb is not available) -> [missing] (J0)
  • [debuginfo-lldb] tests/debuginfo/issue-22656.rs#non-msvc: [missing] -> ignore (lldb is not available) (J0)
  • [debuginfo-lldb] tests/debuginfo/lexical-scope-in-if-let.rs#msvc: [missing] -> ignore (lldb is not available) (J0)
  • [debuginfo-lldb] tests/debuginfo/lexical-scope-in-unconditional-loop.rs#msvc: [missing] -> ignore (lldb is not available) (J0)
  • [debuginfo-lldb] tests/debuginfo/lexical-scope-in-while.rs#msvc: [missing] -> ignore (lldb is not available) (J0)
  • [debuginfo-lldb] tests/debuginfo/lexical-scope-with-macro.rs: ignore (lldb is not available) -> [missing] (J0)
  • [debuginfo-lldb] tests/debuginfo/name-shadowing-and-scope-nesting.rs: ignore (lldb is not available) -> [missing] (J0)
  • [debuginfo-lldb] tests/debuginfo/shadowed-argument.rs#msvc: [missing] -> ignore (lldb is not available) (J0)
  • [debuginfo-lldb] tests/debuginfo/simple-lexical-scope.rs#msvc: [missing] -> ignore (lldb is not available) (J0)

Stage 2

  • [debuginfo-lldb] tests/debuginfo/by-value-self-argument-in-trait-impl.rs#msvc: [missing] -> ignore (only executed when the target environment is msvc) (J1)
  • [debuginfo-lldb] tests/debuginfo/lexical-scope-in-if-let.rs: pass -> [missing] (J1)
  • [debuginfo-lldb] tests/debuginfo/lexical-scope-in-if.rs: pass -> [missing] (J1)
  • [debuginfo-lldb] tests/debuginfo/lexical-scope-in-if.rs#msvc: [missing] -> ignore (only executed when the target environment is msvc) (J1)
  • [debuginfo-lldb] tests/debuginfo/lexical-scope-in-stack-closure.rs: pass -> [missing] (J1)
  • [debuginfo-lldb] tests/debuginfo/lexical-scope-in-unconditional-loop.rs#msvc: [missing] -> ignore (only executed when the target environment is msvc) (J1)
  • [debuginfo-lldb] tests/debuginfo/name-shadowing-and-scope-nesting.rs: pass -> [missing] (J1)
  • [debuginfo-lldb] tests/debuginfo/shadowed-argument.rs: pass -> [missing] (J1)
  • [debuginfo-lldb] tests/debuginfo/shadowed-variable.rs: pass -> [missing] (J1)
  • [debuginfo-lldb] tests/debuginfo/simple-lexical-scope.rs: pass -> [missing] (J1)
  • [debuginfo-lldb] tests/debuginfo/var-captured-in-sendable-closure.rs: pass -> [missing] (J1)
  • [debuginfo-lldb] tests/debuginfo/by-value-self-argument-in-trait-impl.rs: ignore (lldb is not available) -> [missing] (J2)
  • [debuginfo-lldb] tests/debuginfo/lexical-scope-in-while.rs: ignore (lldb is not available) -> [missing] (J2)
  • [debuginfo-lldb] tests/debuginfo/name-shadowing-and-scope-nesting.rs: ignore (lldb is not available) -> [missing] (J2)
  • [debuginfo-lldb] tests/debuginfo/var-captured-in-sendable-closure.rs#msvc: [missing] -> ignore (lldb is not available) (J2)
  • [debuginfo-lldb] tests/debuginfo/var-captured-in-stack-closure.rs: ignore (lldb is not available) -> [missing] (J2)
  • [debuginfo-cdb] tests/debuginfo/by-value-self-argument-in-trait-impl.rs: ignore (cdb is not available) -> [missing] (J3)
  • [debuginfo-cdb] tests/debuginfo/captured-fields-2.rs: ignore (cdb is not available) -> [missing] (J3)
  • [debuginfo-cdb] tests/debuginfo/issue-22656.rs: ignore (cdb is not available) -> [missing] (J3)
  • [debuginfo-cdb] tests/debuginfo/lexical-scope-in-for-loop.rs: ignore (cdb is not available) -> [missing] (J3)
  • [debuginfo-cdb] tests/debuginfo/lexical-scope-in-unconditional-loop.rs#msvc: [missing] -> ignore (cdb is not available) (J3)
  • [debuginfo-cdb] tests/debuginfo/lexical-scope-with-macro.rs: ignore (cdb is not available) -> [missing] (J3)
  • [debuginfo-cdb] tests/debuginfo/shadowed-variable.rs: ignore (cdb is not available) -> [missing] (J3)
  • [debuginfo-cdb] tests/debuginfo/struct-with-destructor.rs#msvc: [missing] -> ignore (cdb is not available) (J3)
  • [debuginfo-cdb (split-dwarf)] tests/debuginfo/by-value-self-argument-in-trait-impl.rs: ignore (cdb is not available) -> [missing] (J4)
  • [debuginfo-cdb (split-dwarf)] tests/debuginfo/coroutine-locals.rs#msvc: [missing] -> ignore (cdb is not available) (J4)
  • [debuginfo-cdb (split-dwarf)] tests/debuginfo/lexical-scope-in-for-loop.rs#msvc: [missing] -> ignore (cdb is not available) (J4)
  • [debuginfo-cdb (split-dwarf)] tests/debuginfo/lexical-scope-in-if-let.rs#msvc: [missing] -> ignore (cdb is not available) (J4)
  • [debuginfo-cdb (split-dwarf)] tests/debuginfo/lexical-scope-in-if.rs: ignore (cdb is not available) -> [missing] (J4)
  • [debuginfo-cdb (split-dwarf)] tests/debuginfo/lexical-scope-in-unconditional-loop.rs: ignore (cdb is not available) -> [missing] (J4)
  • [debuginfo-cdb (split-dwarf)] tests/debuginfo/lexical-scope-in-while.rs#msvc: [missing] -> ignore (cdb is not available) (J4)
  • [debuginfo-cdb (split-dwarf)] tests/debuginfo/simple-lexical-scope.rs: ignore (cdb is not available) -> [missing] (J4)
  • [debuginfo-cdb (split-dwarf)] tests/debuginfo/struct-with-destructor.rs: ignore (cdb is not available) -> [missing] (J4)
  • [debuginfo-cdb (split-dwarf)] tests/debuginfo/struct-with-destructor.rs#msvc: [missing] -> ignore (cdb is not available) (J4)
  • [debuginfo-cdb (split-dwarf)] tests/debuginfo/var-captured-in-sendable-closure.rs#msvc: [missing] -> ignore (cdb is not available) (J4)
  • [debuginfo-gdb (split-dwarf)] tests/debuginfo/lexical-scope-in-stack-closure.rs: pass -> [missing] (J4)
  • [debuginfo-gdb (split-dwarf)] tests/debuginfo/lexical-scope-in-stack-closure.rs#msvc: [missing] -> ignore (only executed when the target environment is msvc) (J4)
  • [debuginfo-gdb (split-dwarf)] tests/debuginfo/lexical-scope-with-macro.rs#msvc: [missing] -> ignore (only executed when the target environment is msvc) (J4)
  • [debuginfo-gdb (split-dwarf)] tests/debuginfo/var-captured-in-nested-closure.rs: pass -> [missing] (J4)
  • [debuginfo-gdb (split-dwarf)] tests/debuginfo/var-captured-in-nested-closure.rs#msvc: [missing] -> ignore (only executed when the target environment is msvc) (J4)
  • [debuginfo-lldb (split-dwarf)] tests/debuginfo/by-value-self-argument-in-trait-impl.rs: ignore (lldb is not available) -> [missing] (J4)
  • [debuginfo-lldb (split-dwarf)] tests/debuginfo/captured-fields-2.rs#msvc: [missing] -> ignore (lldb is not available) (J4)
  • [debuginfo-lldb (split-dwarf)] tests/debuginfo/issue-22656.rs: ignore (lldb is not available) -> [missing] (J4)
  • [debuginfo-lldb (split-dwarf)] tests/debuginfo/lexical-scope-in-while.rs#msvc: [missing] -> ignore (lldb is not available) (J4)
  • [debuginfo-lldb (split-dwarf)] tests/debuginfo/lexical-scope-with-macro.rs#msvc: [missing] -> ignore (lldb is not available) (J4)
  • [debuginfo-lldb (split-dwarf)] tests/debuginfo/name-shadowing-and-scope-nesting.rs: ignore (lldb is not available) -> [missing] (J4)
  • [debuginfo-lldb (split-dwarf)] tests/debuginfo/name-shadowing-and-scope-nesting.rs#msvc: [missing] -> ignore (lldb is not available) (J4)
  • [debuginfo-lldb (split-dwarf)] tests/debuginfo/struct-with-destructor.rs#msvc: [missing] -> ignore (lldb is not available) (J4)
  • [debuginfo-gdb] tests/debuginfo/var-captured-in-nested-closure.rs: ignore (gcc backend is marked as ignore) -> [missing] (J5)
  • [debuginfo-gdb] tests/debuginfo/var-captured-in-sendable-closure.rs: ignore (gcc backend is marked as ignore) -> [missing] (J5)
  • [debuginfo-gdb] tests/debuginfo/var-captured-in-sendable-closure.rs#msvc: [missing] -> ignore (gcc backend is marked as ignore) (J5)
  • [debuginfo-cdb] tests/debuginfo/lexical-scope-in-if.rs: pass -> [missing] (J6)
  • [debuginfo-cdb] tests/debuginfo/lexical-scope-in-unconditional-loop.rs#msvc: [missing] -> ignore (ignored when the target environment is msvc ([LLDB] Shadowed variable printing behavior differs with PDB vs DWARF debug info llvm/llvm-project#221696)) (J6)
  • [debuginfo-cdb] tests/debuginfo/lexical-scope-with-macro.rs#msvc: [missing] -> ignore (ignored when the target environment is msvc ([LLDB] Shadowed variable printing behavior differs with PDB vs DWARF debug info llvm/llvm-project#221696)) (J6)
  • [debuginfo-cdb] tests/debuginfo/name-shadowing-and-scope-nesting.rs#msvc: [missing] -> ignore (ignored when the target environment is msvc ([LLDB] Shadowed variable printing behavior differs with PDB vs DWARF debug info llvm/llvm-project#221696)) (J6)
  • [debuginfo-cdb] tests/debuginfo/simple-lexical-scope.rs#msvc: [missing] -> ignore (ignored when the target environment is msvc ([LLDB] Shadowed variable printing behavior differs with PDB vs DWARF debug info llvm/llvm-project#221696)) (J6)
  • [debuginfo-cdb] tests/debuginfo/var-captured-in-nested-closure.rs: pass -> [missing] (J6)
  • [debuginfo-gdb] tests/debuginfo/by-value-self-argument-in-trait-impl.rs: ignore (gdb tests do not run on msvc) -> [missing] (J6)
  • [debuginfo-gdb] tests/debuginfo/coroutine-locals.rs#msvc: [missing] -> ignore (gdb tests do not run on msvc) (J6)
  • [debuginfo-gdb] tests/debuginfo/lexical-scope-in-for-loop.rs#msvc: [missing] -> ignore (gdb tests do not run on msvc) (J6)
  • [debuginfo-gdb] tests/debuginfo/lexical-scope-in-if.rs#msvc: [missing] -> ignore (gdb tests do not run on msvc) (J6)
  • [debuginfo-gdb] tests/debuginfo/shadowed-argument.rs#msvc: [missing] -> ignore (gdb tests do not run on msvc) (J6)
  • [debuginfo-gdb] tests/debuginfo/simple-lexical-scope.rs: ignore (gdb tests do not run on msvc) -> [missing] (J6)
  • [debuginfo-gdb] tests/debuginfo/var-captured-in-nested-closure.rs: ignore (gdb tests do not run on msvc) -> [missing] (J6)
  • [debuginfo-gdb] tests/debuginfo/issue-22656.rs: ignore (debugger is gdb) -> [missing] (J7)
  • [debuginfo-gdb] tests/debuginfo/issue-22656.rs#non-msvc: [missing] -> ignore (debugger is gdb) (J7)
  • [debuginfo-gdb] tests/debuginfo/by-value-self-argument-in-trait-impl.rs#msvc: [missing] -> ignore (gdb is not available) (J8)
  • [debuginfo-gdb] tests/debuginfo/captured-fields-2.rs#msvc: [missing] -> ignore (gdb is not available) (J8)
  • [debuginfo-gdb] tests/debuginfo/coroutine-locals.rs: ignore (gdb is not available) -> [missing] (J8)
  • [debuginfo-gdb] tests/debuginfo/issue-22656.rs: ignore (gdb is not available) -> [missing] (J8)
  • [debuginfo-gdb] tests/debuginfo/lexical-scope-in-if-let.rs#msvc: [missing] -> ignore (gdb is not available) (J8)
  • [debuginfo-gdb] tests/debuginfo/name-shadowing-and-scope-nesting.rs: ignore (gdb is not available) -> [missing] (J8)
  • [debuginfo-gdb] tests/debuginfo/var-captured-in-sendable-closure.rs#msvc: [missing] -> ignore (gdb is not available) (J8)
  • [debuginfo-gdb] tests/debuginfo/by-value-self-argument-in-trait-impl.rs: pass -> [missing] (J9)
  • [debuginfo-gdb] tests/debuginfo/lexical-scope-in-unconditional-loop.rs#msvc: [missing] -> ignore (only executed when the target environment is msvc) (J9)
  • [debuginfo-gdb] tests/debuginfo/name-shadowing-and-scope-nesting.rs: pass -> [missing] (J9)
  • [debuginfo-gdb] tests/debuginfo/shadowed-variable.rs#msvc: [missing] -> ignore (only executed when the target environment is msvc) (J9)
  • [debuginfo-gdb] tests/debuginfo/var-captured-in-sendable-closure.rs: pass -> [missing] (J9)

(and 445 additional test diffs)

Additionally, 2 doctest diffs were found. These are ignored, as they are noisy.

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 6474e999898cad2289175e2a7d253f5d0f574fa2 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. test-x86_64-msvc-ext2: 1h 16m -> 1h 55m (+51.2%)
  2. dist-x86_64-musl: 1h 33m -> 2h 20m (+49.7%)
  3. test-x86_64-gnu-stdlib-semver-check: 18m 35s -> 11m 8s (-40.1%)
  4. optional-test-x86_64-gnu-autodiff: 58m 48s -> 35m 46s (-39.2%)
  5. test-x86_64-gnu-miri: 1h 1m -> 1h 24m (+38.1%)
  6. test-x86_64-gnu-llvm-21-3: 1h 20m -> 1h 50m (+36.8%)
  7. dist-powerpc64le-linux-gnu: 1h 14m -> 1h 41m (+36.5%)
  8. test-x86_64-gnu-gcc-core-tests: 17m 30s -> 11m 47s (-32.7%)
  9. test-x86_64-gnu-llvm-22-3: 1h 55m -> 1h 18m (-32.2%)
  10. test-x86_64-gnu-llvm-22-2: 1h 43m -> 1h 13m (-28.5%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (6474e99): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This perf run didn't have relevant results for this metric.

Max RSS (memory usage)

Results (primary -0.6%, secondary -2.2%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.6% [-0.9%, -0.4%] 6
Improvements ✅
(secondary)
-2.2% [-2.4%, -2.1%] 2
All ❌✅ (primary) -0.6% [-0.9%, -0.4%] 6

Cycles

Results (primary -0.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.4% [0.4%, 0.4%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.8% [-1.1%, -0.4%] 4
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.4% [-1.1%, 0.4%] 6

Binary size

Results (primary 0.0%, secondary 0.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.0% [0.0%, 0.0%] 5
Regressions ❌
(secondary)
0.0% [0.0%, 0.0%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.0% [0.0%, 0.0%] 5

Bootstrap: 493.573s -> 496.981s (0.69%)
Artifact size: 406.95 MiB -> 406.98 MiB (0.01%)

JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Sep 19, 2026
Use spawned `SBDebugger` instance

As mentioned in rust-lang#162598, this is a small forward-compatibility fix for `tests/debuginfo` with LLDB 23, which seems to be significantly less willing to let us use the parent LLDB instance. I assume this is due to not updating internal/python state while a command is actively being processed (the entire time `debugger_tester` is running, we're in a top-level `script` command)?

We avoided this before because we need to be able to exit with a non-0 status code when not all the expected types/vars are tested, and it wasn't obvious how to get that to happen.

Here, we use `os.kill(os.getpid(), signal.SIGTERM)`, which kills the parent LLDB process from within python. `SIGTERM` is used because `SIGKILL` is unix only, and `SIGABRT` spits out a huge LLDB backtrace with "report this error to LLDB", which is potentially confusing.

The error exit behavior can be tested by deleting one of the `lldb-repr` lines from `tests/debuginfo/basic-types/main.rs`

r? @Kobzol, @jieyouxu
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Sep 19, 2026
Use spawned `SBDebugger` instance

As mentioned in rust-lang#162598, this is a small forward-compatibility fix for `tests/debuginfo` with LLDB 23, which seems to be significantly less willing to let us use the parent LLDB instance. I assume this is due to not updating internal/python state while a command is actively being processed (the entire time `debugger_tester` is running, we're in a top-level `script` command)?

We avoided this before because we need to be able to exit with a non-0 status code when not all the expected types/vars are tested, and it wasn't obvious how to get that to happen.

Here, we use `os.kill(os.getpid(), signal.SIGTERM)`, which kills the parent LLDB process from within python. `SIGTERM` is used because `SIGKILL` is unix only, and `SIGABRT` spits out a huge LLDB backtrace with "report this error to LLDB", which is potentially confusing.

The error exit behavior can be tested by deleting one of the `lldb-repr` lines from `tests/debuginfo/basic-types/main.rs`

r? @Kobzol, @jieyouxu
rust-bors Bot pushed a commit that referenced this pull request Sep 19, 2026
Rollup merge of #162940 - Walnut356:alt_exit, r=Kobzol

Use spawned `SBDebugger` instance

As mentioned in #162598, this is a small forward-compatibility fix for `tests/debuginfo` with LLDB 23, which seems to be significantly less willing to let us use the parent LLDB instance. I assume this is due to not updating internal/python state while a command is actively being processed (the entire time `debugger_tester` is running, we're in a top-level `script` command)?

We avoided this before because we need to be able to exit with a non-0 status code when not all the expected types/vars are tested, and it wasn't obvious how to get that to happen.

Here, we use `os.kill(os.getpid(), signal.SIGTERM)`, which kills the parent LLDB process from within python. `SIGTERM` is used because `SIGKILL` is unix only, and `SIGABRT` spits out a huge LLDB backtrace with "report this error to LLDB", which is potentially confusing.

The error exit behavior can be tested by deleting one of the `lldb-repr` lines from `tests/debuginfo/basic-types/main.rs`

r? @Kobzol, @jieyouxu
pull Bot pushed a commit to xtqqczze/rust-lang-miri that referenced this pull request Sep 20, 2026
Use spawned `SBDebugger` instance

As mentioned in rust-lang/rust#162598, this is a small forward-compatibility fix for `tests/debuginfo` with LLDB 23, which seems to be significantly less willing to let us use the parent LLDB instance. I assume this is due to not updating internal/python state while a command is actively being processed (the entire time `debugger_tester` is running, we're in a top-level `script` command)?

We avoided this before because we need to be able to exit with a non-0 status code when not all the expected types/vars are tested, and it wasn't obvious how to get that to happen.

Here, we use `os.kill(os.getpid(), signal.SIGTERM)`, which kills the parent LLDB process from within python. `SIGTERM` is used because `SIGKILL` is unix only, and `SIGABRT` spits out a huge LLDB backtrace with "report this error to LLDB", which is potentially confusing.

The error exit behavior can be tested by deleting one of the `lldb-repr` lines from `tests/debuginfo/basic-types/main.rs`

r? @Kobzol, @jieyouxu
github-actions Bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Sep 21, 2026
Use spawned `SBDebugger` instance

As mentioned in rust-lang/rust#162598, this is a small forward-compatibility fix for `tests/debuginfo` with LLDB 23, which seems to be significantly less willing to let us use the parent LLDB instance. I assume this is due to not updating internal/python state while a command is actively being processed (the entire time `debugger_tester` is running, we're in a top-level `script` command)?

We avoided this before because we need to be able to exit with a non-0 status code when not all the expected types/vars are tested, and it wasn't obvious how to get that to happen.

Here, we use `os.kill(os.getpid(), signal.SIGTERM)`, which kills the parent LLDB process from within python. `SIGTERM` is used because `SIGKILL` is unix only, and `SIGABRT` spits out a huge LLDB backtrace with "report this error to LLDB", which is potentially confusing.

The error exit behavior can be tested by deleting one of the `lldb-repr` lines from `tests/debuginfo/basic-types/main.rs`

r? @Kobzol, @jieyouxu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. merged-by-bors This PR was explicitly merged by bors. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants