Skip to content

vtable symbols are not marked artificial in DWARF #125126

Open
@tromey

Description

@tromey

I tried this code, from the gdb testsuite:

fn empty () {
}

fn main () {
    let array = [1,2,3,4];
    let slice = &array[1..2];
    let hello = "hello";

    empty();			// STOP
}

I compiled with -g.

Examining the resulting DWARF, I see:

 <1><2a>: Abbrev Number: 2 (DW_TAG_variable)
    <2b>   DW_AT_name        : (indirect string, offset: 0xf3): <std::rt::lang_start::{closure_env#0}<()> as core::ops::function::Fn<()>>::{vtable}
    <2f>   DW_AT_type        : <0x3d>
    <33>   DW_AT_location    : 9 byte block: 3 80 24 5 0 0 0 0 0 	(DW_OP_addr: 52480)

I think this should be marked with DW_AT_artificial, as it does not correspond to any user-written code in the CU. This will let gdb filter out these variables when displaying globals from a CU.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)C-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.WG-debuggingWorking group: Bad Rust debugging experiences

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions