public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.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	[thread overview]
Message-ID: <bug-29385-4717-ap1Yvcm9pi@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-29385-4717@http.sourceware.org/bugzilla/>

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

--- Comment #3 from Tom de Vries <vries at gcc dot gnu.org> ---
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 () != 1)
+      if (per_bfd->types.size () > 1)
        {
          per_bfd->all_comp_units.clear ();
          return false;
        }

-      dwarf2_section_info *section = &per_bfd->types[0];
+      dwarf2_section_info *section
+       = (per_bfd->types.size () == 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=-gdwarf-5.

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

  parent reply	other threads:[~2022-08-12 14:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-19 11:32 [Bug symtab/29385] New: " vries at gcc dot gnu.org
2022-07-19 11:34 ` [Bug symtab/29385] " vries at gcc dot gnu.org
2022-08-12 14:22 ` vries at gcc dot gnu.org
2022-08-12 14:24 ` vries at gcc dot gnu.org [this message]
2022-08-12 15:49 ` vries at gcc dot gnu.org
2022-09-06  8:23 ` vries at gcc dot gnu.org
2022-09-06  8:23 ` vries at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-29385-4717-ap1Yvcm9pi@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).