Skip to content

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

Closed
@michaelwoerister

Description

@michaelwoerister

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions