Skip to content

DWARF regression with impl on nightly #33192

Description

@tromey

I have a function in an impl like:

pub struct HasMethods {
    value: i32
}

impl HasMethods {
    pub fn take(self) -> HasMethods {
        self
    }
}

With nightly, I get DWARF like this:

 <2><178>: Abbrev Number: 3 (DW_TAG_namespace)
    <179>   DW_AT_name        : (indirect string, offset: 0x3d0): {{impl}}
    <17d>   DW_AT_decl_file   : 1
    <17e>   DW_AT_decl_line   : 40
...
 <3><1c8>: Abbrev Number: 11 (DW_TAG_subprogram)
    <1c9>   DW_AT_low_pc      : 0x54c0
    <1d1>   DW_AT_high_pc     : 0x12
    <1d5>   DW_AT_frame_base  : 1 byte block: 56    (DW_OP_reg6 (rbp))
    <1d7>   DW_AT_linkage_name: (indirect string, offset: 0x481): _ZN7methods8{{impl}}4takeE
    <1db>   DW_AT_name        : (indirect string, offset: 0x49c): take
    <1df>   DW_AT_decl_file   : 1
    <1e0>   DW_AT_decl_line   : 50
    <1e1>   DW_AT_type        : <0x90>

There are a few problems with this.

First, the namespace {{impl}} does not seem very useful. In 1.8 the namespace was named HasMethods, after the struct -- this made it quite easy for gdb to find methods associated with a type.

Second, the {{impl}} in the linkage_name also seems peculiar. This is also another situation where the linkage name attribute differs from the real linkage name -- rendering the attribute useless.

if this change was intentional, then I think gdb will need some other way to find the methods in an impl of a particular type. I don't see any way to get that information now.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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