Skip to content

no DWARF difference between references and raw pointers #33073

Closed
@tromey

Description

@tromey

I have a test program that does &x and &x as *const i32. The only difference in the generated DWARF is the name of the pointer type:

 <1><e1>: Abbrev Number: 4 (DW_TAG_pointer_type)
    <e2>   DW_AT_type        : <0x77>
    <e6>   DW_AT_name        : (indirect string, offset: 0xa0): *const i32
...
 <1><4bc>: Abbrev Number: 4 (DW_TAG_pointer_type)
    <4bd>   DW_AT_type        : <0x77>
    <4c1>   DW_AT_name        : (indirect string, offset: 0x38c): &i32

I think it would be better if the DWARF represented the difference via tags or attributes, and not just the type name. One way would be to emit references as DW_TAG_reference_type, and save DW_TAG_pointer_type for raw pointers.

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