Skip to content

inconsistent stepping in gdb #33013

Open
Open
@tromey

Description

@tromey

While experimenting with gdb I found I couldn't really predict what statements I might step to. Consider this test program:

fn main () {
    let a = ();
    let b : [i32; 0] = [];
    let mut c = 27;
    let d = c = 99;
    let e = "hi bob";
    let f = b"hi bob";
    let g = b'9';
    let h = ["whatever"; 8];
    let i = [1,2,3,4];
    let j = (23, "hi");
    let k = 2..3;
    let l = &i[k];
    let m: *const() = &a;
}

If I break step::main and run in gdb, stepping stops on many of these lines, but not all of them:

Breakpoint 1, step::main () at step.rs:4
4       let mut c = 27;
(gdb) n
5       let d = c = 99;
(gdb) 
7       let f = b"hi bob";
(gdb) 
8       let g = b'9';
(gdb) 
12      let k = 2..3;
(gdb) 
13      let l = &i[k];
(gdb) 
14      let m: *const() = &a;
(gdb) 
15  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)C-bugCategory: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.T-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