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

* [Bug symtab/27307] CUs counted twice by create_cus_from_debug_names_list
  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 ` 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
  2 siblings, 0 replies; 4+ messages in thread
From: vries at gcc dot gnu.org @ 2021-02-02 11:38 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
https://sourceware.org/pipermail/gdb-patches/2021-February/175694.html

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

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

* [Bug symtab/27307] CUs counted twice by create_cus_from_debug_names_list
  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
  2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-02-05  8:14 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom de Vries <vries@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d3b54e63f4866551953a03f512049741b0e776c4

commit d3b54e63f4866551953a03f512049741b0e776c4
Author: Tom de Vries <tdevries@suse.de>
Date:   Fri Feb 5 09:14:25 2021 +0100

    [gdb/symtab] Fix duplicate CUs in create_cus_from_debug_names_list

    When running test-case gdb.dwarf2/clang-debug-names.exp, I run into the
    following warning:
    ...
    (gdb) file clang-debug-names^M
    Reading symbols from clang-debug-names...^M
    warning: Section .debug_aranges in clang-debug-names has duplicate \
      debug_info_offset 0xc7, ignoring .debug_aranges.^M
    ...

    This is caused by a missing return in commit 3ee6bb113af "[gdb/symtab] Fix
    incomplete CU list assert in .debug_names".

    Fix this by adding the missing return, such that we have instead this
warning:
    ...
    (gdb) file clang-debug-names^M
    Reading symbols from clang-debug-names...^M
    warning: Section .debug_aranges in clang-debug-names \
      entry at offset 0 debug_info_offset 0 does not exists, \
      ignoring .debug_aranges.^M
    ...
    which is a known problem filed as PR25969 - "Ignoring .debug_aranges with
    clang .debug_names".

    Tested on x86_64-linux.

    gdb/ChangeLog:

    2021-02-05  Tom de Vries  <tdevries@suse.de>

            PR symtab/27307
            * dwarf2/read.c (create_cus_from_debug_names_list): Add missing
            return.

    gdb/testsuite/ChangeLog:

    2021-02-05  Tom de Vries  <tdevries@suse.de>

            PR symtab/27307
            * gdb.dwarf2/clang-debug-names.exp: Check file command warnings.

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

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

* [Bug symtab/27307] CUs counted twice by create_cus_from_debug_names_list
  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
  2 siblings, 0 replies; 4+ messages in thread
From: vries at gcc dot gnu.org @ 2021-02-05  8:20 UTC (permalink / raw)
  To: gdb-prs

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

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED
   Target Milestone|---                         |11.1

--- Comment #3 from Tom de Vries <vries at gcc dot gnu.org> ---
Patch with test-case committed, marking resolved-fixed.

-- 
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).