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/29381] [gdb, debug-types, debug-names] read.h:309: internal-error: set_length: Assertion `m_length == length' failed.
Date: Tue, 19 Jul 2022 08:36:35 +0000	[thread overview]
Message-ID: <bug-29381-4717-DtYYwrTqeO@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-29381-4717@http.sourceware.org/bugzilla/>

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

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
This addresses problem 2, both for .debug_names and .gdb_index:
...
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index bcd01107377..3b4409fa8ca 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -2696,7 +2696,10 @@ dwarf2_read_gdb_index
       /* We can only handle a single .debug_types when we have an
         index.  */
       if (per_bfd->types.size () != 1)
-       return 0;
+       {
+         per_bfd->all_comp_units.clear ();
+         return 0;
+       }

       dwarf2_section_info *section = &per_bfd->types[0];

@@ -4701,7 +4704,10 @@ 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)
-       return false;
+       {
+         per_bfd->all_comp_units.clear ();
+         return false;
+       }

       dwarf2_section_info *section = &per_bfd->types[0];

@@ -7206,6 +7212,7 @@ static void
 create_all_comp_units (dwarf2_per_objfile *per_objfile)
 {
   htab_up types_htab;
+  gdb_assert (per_objfile->per_bfd->all_comp_units.empty ());

   read_comp_units_from_section (per_objfile, &per_objfile->per_bfd->info,
                                &per_objfile->per_bfd->abbrev, 0,
...

Also adds an assert to detect the problem asap.  A similar assert is already
present in create_cus_from_index and create_cus_from_debug_names.

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

  reply	other threads:[~2022-07-19  8:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-19  7:59 [Bug symtab/29381] New: " vries at gcc dot gnu.org
2022-07-19  8:36 ` vries at gcc dot gnu.org [this message]
2022-07-19 10:02 ` [Bug symtab/29381] " vries at gcc dot gnu.org
2022-07-19 10:24 ` vries at gcc dot gnu.org
2022-07-19 11:34 ` vries at gcc dot gnu.org
2022-07-19 13:14 ` vries at gcc dot gnu.org
2022-07-19 16:50 ` vries at gcc dot gnu.org
2022-07-19 17:36 ` vries at gcc dot gnu.org
2022-07-22 21:52 ` vries at gcc dot gnu.org
2022-08-01 12:04 ` 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-29381-4717-DtYYwrTqeO@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).