Skip to content

debuginfo: Stepping through if-expressions jumps around unexpectedly #19542

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

Closed
michaelwoerister opened this issue Dec 5, 2014 · 1 comment
Closed
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.)

Comments

@michaelwoerister
Copy link
Member

Given the following program, stepping through the if statement will jump into the else-branch several times although it should only visit the then-branch.

 1  
 2   fn main() {
 3      let TRUE = true;
 4      let THEN = 0i;
 5      let ELSE = 1i;
 6
 7      let _ = if TRUE == TRUE { 
 8          THEN + 1
 9      } else {
10          ELSE + 1
11      };
12   }

GDB stepping log:

7       let _ = if TRUE == TRUE {
(gdb) n
10          ELSE + 1
(gdb) n
8           THEN + 1
(gdb) n
10          ELSE + 1
(gdb) n
12  }

This seems to be a regression a variation of which has already been fixed at least once. The last time the problem was the side-effect based API of setting source locations in trans.

@michaelwoerister michaelwoerister added the A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) label Dec 5, 2014
@michaelwoerister
Copy link
Member Author

Fixed in #20642

lnicola pushed a commit to lnicola/rust that referenced this issue May 5, 2025
refactor: migrate `let_else_to_match` to editor
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.)
Projects
None yet
Development

No branches or pull requests

1 participant