Skip to content

DWARF doesn't record mut/const distinction #32921

Closed as not planned
Closed as not planned
@tromey

Description

@tromey

Consider code like this:

    let y : u8 = 8;
    let x : *const u8 = &y;
    let mut w : u8 = 9;
    let z : *mut u8   = & mut w;

Examining the DWARF for these, the types lose some information:

 <1><90>: Abbrev Number: 6 (DW_TAG_base_type)
    <91>   DW_AT_name        : (indirect string, offset: 0x65): u8
    <95>   DW_AT_encoding    : 7    (unsigned)
    <96>   DW_AT_byte_size   : 1
 <1><97>: Abbrev Number: 7 (DW_TAG_pointer_type)
    <98>   DW_AT_type        : <0x90>
    <9c>   DW_AT_name        : (indirect string, offset: 0x5e): *const u8
 <1><a0>: Abbrev Number: 7 (DW_TAG_pointer_type)
    <a1>   DW_AT_type        : <0x90>
    <a5>   DW_AT_name        : (indirect string, offset: 0x6c): *mut u8

Something here should be marked DW_TAG_const_type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)C-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions