public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "sungdgdhtryrt at gmail dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug gdb/31497] gdb internal fatal error while opening a core dump; binary built with '-gsplit-dwarf'
Date: Sun, 17 Mar 2024 07:37:21 +0000	[thread overview]
Message-ID: <bug-31497-4717-PRPYLcMlLS@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-31497-4717@http.sourceware.org/bugzilla/>

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

--- Comment #2 from Hans <sungdgdhtryrt at gmail dot com> ---
Thank you for your very valuable advice. Your assumption about the
missing read for the str_offset section was correct. Adding a read in
read_dwo_str_index() prevents the crash and gdb is happy.
Although the read will be called twice now in read_dwo_str_index() and
read_str_index().

Thanks again for your help.


diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 4afb026b8ce..a54e783d614 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -17483,6 +17483,12 @@ read_dwo_str_index (const struct die_reader_specs
*reader, ULONGEST str_index)
         so assume the .debug_str_offsets section is DWARF5 as well, and
         parse the header.  FIXME: Parse the header only once.  */
       unsigned int bytes_read = 0;
+
+      // @@@
+      struct objfile *objfile = reader->cu->per_objfile->objfile;
+      reader->dwo_file->sections.str_offsets.read (objfile);
+      // @@@
+
       bfd *abfd = reader->dwo_file->sections.str_offsets.get_bfd_owner ();
       const gdb_byte *p = reader->dwo_file->sections.str_offsets.buffer;

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

  parent reply	other threads:[~2024-03-17  7:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-16  7:42 [Bug gdb/31497] New: " sungdgdhtryrt at gmail dot com
2024-03-16 16:17 ` [Bug gdb/31497] " tromey at sourceware dot org
2024-03-17  4:01 ` sam at gentoo dot org
2024-03-17  7:37 ` sungdgdhtryrt at gmail dot com [this message]
2024-03-17 22:01 ` tromey at sourceware dot org
2024-03-18 18:05 ` sungdgdhtryrt at gmail dot com
2024-03-19 13:18 ` tromey at sourceware dot 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-31497-4717-PRPYLcMlLS@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).