Skip to content

Rust DWARF debug info creates duplicate DW_TAG_structure_types with the same name #52762

Closed
@rocallahan

Description

@rocallahan

Given this pretty common pattern

enum Foo { Bar(Bar) }
struct Bar { ... }

rustc generates two DW_TAG_structure_type entries in the same namespace both called Bar, one for the Rust struct, the other for the Foo::Bar variant. This is a problem for tools that want to refer to DWARF structure types by name (e.g. when trying to guess type identities across compilation unit boundaries). It would also be a problem if a user tries to refer to the type Bar in the user interface of a debugger (without additional hacks like ignoring types containing RUST$ENUM$DISR).

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