Skip to content

format!() generates code without line number debug info #20292

Closed
@vadimcn

Description

@vadimcn

Compile the following with -g flag, then try stepping line-by-line in gdb:

fn main() {
    let a = 42
    println!("The answer = {}", a);
    println!("The end!");
}

After each printlt!() statement the execution point jumps to the first line of the function.
Examination of LLVM IR shows that much of the fmt::Arguments construction code has no line debug metadata attached to it (or at least that's what I think that code does).

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions