Skip to content

DWARF doesn't record mut/const distinction #32921

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tromey opened this issue Apr 12, 2016 · 4 comments
Closed

DWARF doesn't record mut/const distinction #32921

tromey opened this issue Apr 12, 2016 · 4 comments
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) C-bug Category: This is a bug.

Comments

@tromey
Copy link
Contributor

tromey commented Apr 12, 2016

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.

@tromey
Copy link
Contributor Author

tromey commented Apr 12, 2016

Sorry, I meant DW_TAG_const_type.

@Aatch Aatch added the A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) label Apr 13, 2016
@Aatch
Copy link
Contributor

Aatch commented Apr 13, 2016

@tromey just FYI, you can edit your own comments/issues

@Mark-Simulacrum Mark-Simulacrum added the C-bug Category: This is a bug. label Jul 25, 2017
@steveklabnik
Copy link
Member

Triage: not sure if anything has changed here, but I don't think so.

@wesleywiser
Copy link
Member

Visited during wg-debugging. It looks like this is essentially the same issue as #37504 so we're closing this since the other issue has much more discussion and we'd like to keep it all in one place.

@wesleywiser wesleywiser closed this as not planned Won't fix, can't repro, duplicate, stale Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) C-bug Category: This is a bug.
Projects
None yet
Development

No branches or pull requests

5 participants