Skip to content

wrong line number for function in DWARF #33146

Closed
@tromey

Description

@tromey

Consider this test case:

fn main() {
    p();
}

fn p() {
    println!("Hi");
}

If I compile this and then examine the resulting DWARF line table for p, I see that it apparently covers line 2:

./p.rs:[++]
p.rs                                           5              0x4c50
p.rs                                           2              0x4cd8
p.rs                                           7              0x4cf1

A somewhat easy way to see this is with disassemble/s in gdb. (Also for some reason gdb thinks that this line 2 is the end of the prologue for the function, but from the disassembly this is many instructions in, so I think something else weird is going on here.)

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