Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] gdb internal fatal error while opening a binary built with gsplit-dwarf
@ 2024-03-22 17:01 Hans
  0 siblings, 0 replies; only message in thread
From: Hans @ 2024-03-22 17:01 UTC (permalink / raw)
  To: gdb-patches; +Cc: Hans, Tom Tromey

Binaries built with '-gsplit-dwarf' and clang-16 using dwp with
dwarf version 5 will crash with a segmentation fault as a result
of a missing section read call in read_dwo_str_index(). Without
the split dwarf option everything works fine. The error occurs
from commit 65067f1c2c842f001017638c4fe53613d6656263 until latest,
previous commits work without problems. Steps to reproduce are in
the bug description.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31497
Reviewed-by: Tom Tromey <tom@tromey.com>
---
 gdb/dwarf2/read.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 7442094874c..a45bc512724 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -17501,6 +17501,9 @@ read_dwo_str_index (const struct die_reader_specs *reader, ULONGEST str_index)
   ULONGEST str_offsets_base;
   if (reader->cu->header.version >= 5)
     {
+      struct objfile *objfile = reader->cu->per_objfile->objfile;
+      reader->dwo_file->sections.str_offsets.read (objfile);
+
       /* We have a DWARF5 CU with a reference to a .debug_str_offsets section,
 	 so assume the .debug_str_offsets section is DWARF5 as well, and
 	 parse the header.  FIXME: Parse the header only once.  */
-- 
2.34.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-03-22 17:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-22 17:01 [PATCH] gdb internal fatal error while opening a binary built with gsplit-dwarf Hans

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox