From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4B70E3858D28; Fri, 12 Aug 2022 14:24:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4B70E3858D28 From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug symtab/29385] [gdb, debug-types, debug-names, dwarf-5] Support .debug_names section with TUs in .debug_info Date: Fri, 12 Aug 2022 14:24:32 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: symtab X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: vries at gcc dot gnu.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: Message-ID: In-Reply-To: References: 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: Fri, 12 Aug 2022 14:24:32 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D29385 --- Comment #3 from Tom de Vries --- Tentative patch (in combination with patch mentioned in previous comment): ... diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 6c6ca96f8d9..8e82f464293 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -4736,13 +4736,16 @@ dwarf2_read_debug_names (dwarf2_per_objfile *per_objfile) { /* We can only handle a single .debug_types when we have an index. */ - if (per_bfd->types.size () !=3D 1) + if (per_bfd->types.size () > 1) { per_bfd->all_comp_units.clear (); return false; } - dwarf2_section_info *section =3D &per_bfd->types[0]; + dwarf2_section_info *section + =3D (per_bfd->types.size () =3D=3D 1 + ? &per_bfd->types[0] + : &per_bfd->info); create_signatured_type_table_from_debug_names (per_objfile, *map, section, &per_bfd->abbrev); ... Allows test-case gdb.cp/cpexprs-debug-types.exp to pass on target board cc-with-debug-names/gdb:debug_flags=3D-gdwarf-5. --=20 You are receiving this mail because: You are on the CC list for the bug.=