Skip to content

Improve Windows debugger launcher - #162620

Open
fgiancane8 wants to merge 1 commit into
rust-lang:mainfrom
fgiancane8:feature/improve-windbg.cmd-on-windows
Open

fgiancane8 wants to merge 1 commit into
rust-lang:mainfrom
fgiancane8:feature/improve-windbg.cmd-on-windows

Conversation

@fgiancane8

Copy link
Copy Markdown

While testing a trivial Rust application on my Windows machine, I discovered that rust-windbg.cmd could only launch windbg (legacy Windows debugger), could not detect windbgx, the more modern Windows debugger that fully supports Rust.
Prefer windbgx when available, fall back to windbg if the former is not available, propagate the debugger exit status, and report a clear error when neither debugger is found.

Executed tests:
[x] windbgx available -> launched correctly
[x] windbgx not available, windbg available -> legacy windbg called
[x] neither available -> error message printed

When a debugger is found and launched successfully, the script returns its exit code (0 normally). When neither debugger is found, PowerShell reports $LASTEXITCODE as 1.

LLM disclosure: I wrote the commit by hand after finding the issue myself. I used an LLM to review the commit before submitting.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 11, 2026
@rustbot

rustbot commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the pull request, and welcome! The Rust Project has assigned @Mark-Simulacrum (or someone else) to review your changes, you should hear from them (or someone else) within the next two weeks.

Please see the contribution instructions and our LLM policy for more information.

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @Mark-Simulacrum

@rustbot

This comment has been minimized.

@rustbot rustbot added has-merge-commits PR has merge commits, merge with caution. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 11, 2026
Prefer windbgx when available, fall back to windbg, propagate the
debugger exit status, and report a clear error when neither debugger
is found.
@fgiancane8
fgiancane8 force-pushed the feature/improve-windbg.cmd-on-windows branch from ba9caf6 to e740c2d Compare September 11, 2026 02:22
@rustbot rustbot removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. has-merge-commits PR has merge commits, merge with caution. labels Sep 11, 2026
@ChrisDenton

Copy link
Copy Markdown
Member

Is the cmd script actually useful now that natvis files are embedded in the pdbs?

@fgiancane8

Copy link
Copy Markdown
Author

Good catch. Probably it is now automatically managed by WinDbgX configuration but I haven't checked.
Are you suggesting there's no need to explicitly load natvis files any more or just recommending not to start debugging through the command line script at all?

@ChrisDenton

Copy link
Copy Markdown
Member

I think the cmd scripts should be considered deprecated as they're now redundant. We could also consider removing them but if we do that we should emit a deprecation warning first.

@fgiancane8

Copy link
Copy Markdown
Author

I think the cmd scripts should be considered deprecated as they're now redundant. We could also consider removing them but if we do that we should emit a deprecation warning first.

Thanks for the inputs. Should I update this pull request with a deprecation warning/message first, or shall we just ignore it here?

@Mark-Simulacrum

Copy link
Copy Markdown
Member

r? ChrisDenton

cc @Walnut356

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants