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

Variable scoping sometimes inconsistent when debugging #112798

Open
wesleywiser opened this issue Jun 19, 2023 · 0 comments
Open

Variable scoping sometimes inconsistent when debugging #112798

wesleywiser opened this issue Jun 19, 2023 · 0 comments
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

I tried this code:

fn main() {
  let a = 5;
  let b = 6;
  let c = a + b;
  println!("Hello world {c}");
}

I expected to see this happen:
When setting a breakpoint on the line 2, no variables should be in scope. Then stepping forward one line shows just a in scope, etc.

Instead, this happened:
Both a and b were in scope but "unavailable". c was correctly not in scope until the println!().

Meta

rustc --version --verbose:

rustc 1.70.0 (90c541806 2023-05-31)
binary: rustc
commit-hash: 90c541806f23a127002de5b4038be731ba1458ca
commit-date: 2023-05-31
host: x86_64-pc-windows-msvc
release: 1.70.0
LLVM version: 16.0.2

This may be a Windows specific debugging issue.

@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 Jun 19, 2023
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

No branches or pull requests

1 participant