From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 692453857001; Sun, 23 Aug 2020 11:13:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 692453857001 From: "mark at klomp dot org" To: gdb-prs@sourceware.org Subject: [Bug c++/26525] New: DWARF5 class variables are not data members, DW_TAG_member, but DW_TAG_variable. Date: Sun, 23 Aug 2020 11:13:24 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: c++ X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mark at klomp dot org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Aug 2020 11:13:24 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D26525 Bug ID: 26525 Summary: DWARF5 class variables are not data members, DW_TAG_member, but DW_TAG_variable. Product: gdb Version: unknown Status: NEW Severity: normal Priority: P2 Component: c++ Assignee: unassigned at sourceware dot org Reporter: mark at klomp dot org Target Milestone: --- Before DWARF5 there was no description of class variables (static data memb= ers) and gcc would emit a DW_TAG_member for the class variables as if the were non-static data members. DWARF5, section 5.7.7 Class Variable Entries, says they are represented by a DW_TAG_variable. GCC has the following in dwarf2out.c: /* For static data members, the declaration in the class is supposed=20= =20=20=20=20=20=20=20=20=20 to have DW_TAG_member tag in DWARF{3,4} and we emit it for compatibili= ty=20=20=20 also in DWARF2; the specification should still be DW_TAG_variable=20= =20=20=20=20=20=20=20=20=20 referencing the DW_TAG_member DIE. */ if (declaration && class_scope_p (context_die) && dwarf_version < 5) var_die =3D new_die (DW_TAG_member, context_die, decl); else var_die =3D new_die (DW_TAG_variable, context_die, decl); if (origin !=3D NULL) add_abstract_origin_attribute (var_die, origin); This means that when building with -gdwarf-5 there no longer is a DW_TAG_me= mber for static data members, but an DW_TAG_variable (which can be optimized away when not referenced). This causes the following testsuite failures: FAIL: gdb.base/ptype-offsets.exp: ptype/o static_member FAIL: gdb.cp/constexpr-field.exp: print y FAIL: gdb.cp/m-static.exp: static const int initialized nowhere (print fiel= d) FAIL: gdb.cp/m-static.exp: ptype test4.nowhere FAIL: gdb.cp/m-static.exp: print test4.nowhere.nowhere FAIL: gdb.cp/m-static.exp: static const int initialized nowhere (whole stru= ct) FAIL: gdb.cp/m-static.exp: static const int initialized in class definition FAIL: gdb.cp/m-static.exp: static const float initialized in class definiti= on FAIL: gdb.cp/m-static.exp: info variable everywhere FAIL: gdb.cp/namespace.exp: print C::OtherFileClass::cOtherFileClassVar FAIL: gdb.cp/namespace.exp: print ::C::OtherFileClass::cOtherFileClassVar FAIL: gdb.cp/namespace.exp: ptype ::C::OtherFileClass typedefs FAIL: gdb.cp/namespace.exp: ptype OtherFileClass typedefs FAIL: gdb.cp/pr-574.exp: PR gdb/574 FAIL: gdb.cp/pr9167.exp: p b FAIL: gdb.cp/templates.exp: ptype T5 FAIL: gdb.cp/templates.exp: ptype t5i --=20 You are receiving this mail because: You are on the CC list for the bug.=