Skip to content

no DWARF difference between references and raw pointers #33073

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 18, 2016 · 2 comments
Closed

no DWARF difference between references and raw pointers #33073

tromey opened this issue Apr 18, 2016 · 2 comments
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.)

Comments

@tromey
Copy link
Contributor

tromey commented Apr 18, 2016

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.

@nagisa nagisa added the A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) label Apr 18, 2016
@michaelwoerister
Copy link
Member

Agreed.

@Mark-Simulacrum
Copy link
Member

I'm going to close this in favor of #37504, since that has much more elaborate discussion on this topic and the difficulties involved.

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.)
Projects
None yet
Development

No branches or pull requests

4 participants