Skip to content

DWARF omits typedef #32575

Open
Open
@tromey

Description

@tromey

I'm using rustc from the Fedora COPR:

bapiya. rustc --version
rustc 1.7.0 (a5d1e7a59 2016-02-29)

Consider this program:

pub type Xty = fn() -> u32;

fn x() -> u32 {
    return 57u32;
}

pub static AA: Xty = x;

fn main() {
    println!("{}", AA());
}

I compile this with -g and then look for the type Xty in the DWARF using readelf. It isn't there:

bapiya. readelf -wi B1 | grep Xty
bapiya. 

If I examine the type of AA, it ends up here:

 <1><14b>: Abbrev Number: 11 (DW_TAG_pointer_type)
    <14c>   DW_AT_type        : <0x154>
    <150>   DW_AT_name        : (indirect string, offset: 0x4b): fn() -> u32
 <1><154>: Abbrev Number: 12 (DW_TAG_subroutine_type)
    <155>   DW_AT_type        : <0x159>
[...]

That is, the typedef has been dropped.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)C-bugCategory: This is a bug.P-lowLow priorityT-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