Skip to content

When debugging on windows-msvc, closure environments cannot be inspected #83709

Closed
@wesleywiser

Description

@wesleywiser

I compiled the following program and started debugging in Windbg:

fn main() {
    let x: i32 = 123;
    let y: i32 = x * 2;
    let closure = || {
        x + y
    };

    std::process::exit(closure());
}

but after stepping inside closure, it's not possible to inspect the x or y variables.

image

Meta

rustc --version --verbose:

rustc 1.52.0-nightly (4a8b6f708 2021-03-11)
binary: rustc
commit-hash: 4a8b6f708c38342a6c74aa00cf4323774c7381a6
commit-date: 2021-03-11
host: x86_64-pc-windows-msvc
release: 1.52.0-nightly
LLVM version: 12.0.0

Windbg 1.2103.01004.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-closuresArea: Closures (`|…| { … }`)A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)C-bugCategory: This is a bug.O-windows-msvcToolchain: MSVC, Operating system: WindowsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions