Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arguments passed as ScalarPairs do not work correctly with Windows debuggers #88625

Closed
wesleywiser opened this issue Sep 3, 2021 · 0 comments · Fixed by #88629
Closed

Arguments passed as ScalarPairs do not work correctly with Windows debuggers #88625

wesleywiser opened this issue Sep 3, 2021 · 0 comments · Fixed by #88629
Assignees
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) C-bug Category: This is a bug. O-windows-msvc Toolchain: MSVC, Operating system: Windows

Comments

@wesleywiser
Copy link
Member

Arguments passed via the ScalarPair abi cannot be correctly inspected via WinDbg or VS debuggers. This occurs because the platform debuggers expect the type to passed via a pointer (as the abi says they should) and the debuggers are hardcoded to expect that.

Example:

fn foo(r: Range<usize>) {
    zzz(); // #break
}

Debuggers:

> dx r
r               : 0x14 [Type: core::ops::range::Range<usize> *]

(Notice the * in the type indicating the debugger expects to be looking at a pointer to the actual value, not it passed by value)

This is a more general version of #81894 which #81898 fixed for &str and slices.

@wesleywiser wesleywiser added A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) O-windows-msvc Toolchain: MSVC, Operating system: Windows C-bug Category: This is a bug. labels Sep 3, 2021
@wesleywiser wesleywiser self-assigned this Sep 3, 2021
Manishearth added a commit to Manishearth/rust that referenced this issue Sep 12, 2021
…rpair_params, r=oli-obk

Fix debuginfo for parameters passed via the ScalarPair abi on Windows

Mark all of these as locals so the debugger does not try to interpret
them as being a pointer to the value. This extends the approach used
in rust-lang#81898.

Fixes rust-lang#88625
@bors bors closed this as completed in 5fd6f3b Sep 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) C-bug Category: This is a bug. O-windows-msvc Toolchain: MSVC, Operating system: Windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant