Skip to content

improve the current debugger autodetection functionality.#153288

Open
Unique-Usman wants to merge 1 commit intorust-lang:mainfrom
Unique-Usman:ua/improvedebuggerdetection
Open

improve the current debugger autodetection functionality.#153288
Unique-Usman wants to merge 1 commit intorust-lang:mainfrom
Unique-Usman:ua/improvedebuggerdetection

Conversation

@Unique-Usman
Copy link
Contributor

CDB:

  • Add support for overriding via RUSTC_CDB.
  • Derive architecture from the target triple instead of cfg!(target_arch).
  • Search multiple Windows SDK versions (11, 10, 8.1).
  • Probe both ProgramFiles(x86) and ProgramFiles.

GDB:

  • Treat empty config.gdb as an explicit opt-out.
  • Extract validation logic into a verify_gdb helper.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Mar 2, 2026
@rustbot
Copy link
Collaborator

rustbot commented Mar 2, 2026

r? @jieyouxu

rustbot has assigned @jieyouxu.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: bootstrap
  • bootstrap expanded to 6 candidates
  • Random selection from Mark-Simulacrum, clubby789, jieyouxu

@Unique-Usman
Copy link
Contributor Author

@Kobzol tagging you here.

Copy link
Member

@hkBst hkBst left a comment

Choose a reason for hiding this comment

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

This looks mostly good to me.

View changes since this review

// as a way to explicitly disable ambient gdb discovery.
let gdb = Cow::Borrowed(gdb);
return Some(Gdb { gdb });
if gdb.as_os_str().is_empty() {
Copy link
Member

Choose a reason for hiding this comment

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

There is an unstable is_empty impl on Path that you could use here. Maybe just:

Suggested change
if gdb.as_os_str().is_empty() {
if gdb.is_empty() {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

bootstrap does not all this feature.

   Compiling bootstrap v0.0.0 (/home/uniqueusman/rust/src/bootstrap)
error[E0725]: the feature `path_is_empty` is not in the list of allowed features
  --> src/bootstrap/src/lib.rs:19:12
   |
19 | #![feature(path_is_empty)]
   |            ^^^^^^^^^^^^^

return None;
}

let gdb = Cow::Borrowed(Path::new(gdb));
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand what this line is doing. Can you explain why this is necessary?

Copy link
Contributor Author

@Unique-Usman Unique-Usman Mar 2, 2026

Choose a reason for hiding this comment

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

My bad, the gdb is already &Path, that is redundant, will change.

CDB:
- Add support for overriding via `RUSTC_CDB`.
- Derive architecture from the target triple instead of `cfg!(target_arch)`.
- Search multiple Windows SDK versions (11, 10, 8.1).
- Probe both `ProgramFiles(x86)` and `ProgramFiles`.

GDB:
- Treat empty `config.gdb` as an explicit opt-out.
- Extract validation logic into a `verify_gdb` helper.

Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
@Unique-Usman Unique-Usman force-pushed the ua/improvedebuggerdetection branch from ccd7ce3 to f88c548 Compare March 2, 2026 16:27
@Unique-Usman Unique-Usman requested a review from hkBst March 2, 2026 16:28
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. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants