public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug symtab/27307] New: CUs counted twice by create_cus_from_debug_names_list
@ 2021-02-01 11:22 vries at gcc dot gnu.org
  2021-02-02 11:38 ` [Bug symtab/27307] " vries at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: vries at gcc dot gnu.org @ 2021-02-01 11:22 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27307

            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
        = 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_off));
          return;
        }
    }
...
and had difficulty understanding this.

The iteration is over all_comp_units, which has no relation to .debug_aranges,
so the warning does not make sense.

I tried to see if I could trigger it, so I added a "gdb_assert (false)" after
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,
          = create_cu_from_index_list (per_bfd, &section, is_dwz, sect_off, 0);
        per_bfd->all_comp_units.push_back (per_cu);
       }
+    return;
     }

   sect_offset sect_off_prev;
...

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-02-05  8:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-01 11:22 [Bug symtab/27307] New: CUs counted twice by create_cus_from_debug_names_list vries at gcc dot gnu.org
2021-02-02 11:38 ` [Bug symtab/27307] " vries at gcc dot gnu.org
2021-02-05  8:14 ` cvs-commit at gcc dot gnu.org
2021-02-05  8:20 ` vries at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).