This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
FYI: fix crash resulting from lazy loading patch
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Wed, 17 Mar 2010 13:09:49 -0600
- Subject: FYI: fix crash resulting from lazy loading patch
- Reply-to: tromey at redhat dot com
I'm checking this in.
The patch to add lazy loading for dwarf sections caused a crash when I
was debugging a gcj-compiled program. The crash occurred because the
fake objfile made by jv-lang.c doesn't have any dwarf sections.
The fix is to make dwarf2_get_section_info return "no section" in this
case.
Built and regtested on x86-64 (compile farm). I also tested it locally
by debugging the same program.
Tom
2010-03-17 Tom Tromey <tromey@redhat.com>
* dwarf2read.c (dwarf2_get_section_info): Handle case where no
DWARF data is available.
Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.369
diff -u -r1.369 dwarf2read.c
--- dwarf2read.c 16 Mar 2010 20:51:23 -0000 1.369
+++ dwarf2read.c 17 Mar 2010 19:07:08 -0000
@@ -1397,6 +1397,16 @@
struct dwarf2_per_objfile *data
= objfile_data (objfile, dwarf2_objfile_data_key);
struct dwarf2_section_info *info;
+
+ /* We may see an objfile without any DWARF, in which case we just
+ return nothing. */
+ if (data == NULL)
+ {
+ *sectp = NULL;
+ *bufp = NULL;
+ *sizep = 0;
+ return;
+ }
if (section_is_p (section_name, EH_FRAME_SECTION))
info = &data->eh_frame;
else if (section_is_p (section_name, FRAME_SECTION))