From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A1B773870884; Mon, 1 Feb 2021 11:22:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A1B773870884 From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug symtab/27307] New: CUs counted twice by create_cus_from_debug_names_list Date: Mon, 01 Feb 2021 11:22:16 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: symtab X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal 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: 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: Mon, 01 Feb 2021 11:22:16 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D27307 Bug ID: 27307 Summary: CUs counted twice by create_cus_from_debug_names_list Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: symtab Assignee: unassigned at sourceware dot org Reporter: vries at gcc dot gnu.org Target Milestone: --- I stumbled upon this code in create_addrmap_from_aranges: ... for (dwarf2_per_cu_data *per_cu : per_objfile->per_bfd->all_comp_units) { const auto insertpair =3D debug_info_offset_to_per_cu.emplace (per_cu->sect_off, per_cu); if (!insertpair.second) { warning (_("Section .debug_aranges in %s has duplicate " "debug_info_offset %s, ignoring .debug_aranges."), objfile_name (objfile), sect_offset_str (per_cu->sect_of= f)); return; } } ... and had difficulty understanding this. The iteration is over all_comp_units, which has no relation to .debug_arang= es, so the warning does not make sense. I tried to see if I could trigger it, so I added a "gdb_assert (false)" aft= er the warning. I ran into the assert in test-cases gdb.dwarf2/clang-debug-names.exp and gdb.dwarf2/clang-debug-names-2.exp. Investigation showed that this is due to a bug in create_cus_from_debug_names_list, which is fixed by: ... @@ -5323,6 +5324,7 @@ create_cus_from_debug_names_list (dwarf2_per_bfd *per= _bf d, =3D create_cu_from_index_list (per_bfd, §ion, is_dwz, sect_of= f, 0); per_bfd->all_comp_units.push_back (per_cu); } + return; } sect_offset sect_off_prev; ... --=20 You are receiving this mail because: You are on the CC list for the bug.=