https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101378

            Bug ID: 101378
           Summary: Negative DW_AT_data_member_location
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: simon.marchi at polymtl dot ca
  Target Milestone: ---

I'm at 1ca642d785c49e9e0b28651b190720267703f023 (current master).

$ cat test.cpp
#include <memory>

int main() {
  std::unique_ptr<int> p(new int);
  return 0;
}
$ /opt/gcc/git/bin/g++ test.cpp -g3 -O0
$ readelf --debug-dump a.out
...
 <3><968>: Abbrev Number: 79 (DW_TAG_member)
    <969>   DW_AT_name        : (indirect string, offset: 0xc214): _M_head_impl
    <96d>   DW_AT_decl_file   : 4
    <96e>   DW_AT_decl_line   : 125
    <96f>   DW_AT_decl_column : 39
    <970>   DW_AT_type        : <0x67e>
    <974>   DW_AT_data_member_location: -1
...

The -1 DW_AT_data_member_location value looks wrong.  Previous gcc versions
would say 0, which makes more sense.  It doesn't seem to change anything
whether I use DWARF 4 or 5.

Related GDB bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28063

Reply via email to