This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[ob] Fix dwarf2 reader crash
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: gdb-patches at sourceware dot org
- Date: Sun, 28 Jan 2007 15:42:29 +0100 (CET)
- Subject: [ob] Fix dwarf2 reader crash
DW_AT_decl_file can be zero, indicating no file. It's better not to
crash in that case.
Mark
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* dwarf2read.c (new_symbol): Handle DW_AT_decl_file being zero.
Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.213
diff -u -p -r1.213 dwarf2read.c
--- dwarf2read.c 23 Jan 2007 23:57:47 -0000 1.213
+++ dwarf2read.c 28 Jan 2007 14:39:55 -0000
@@ -7079,7 +7079,7 @@ new_symbol (struct die_info *die, struct
|| file_index > cu->line_header->num_file_names)
complaint (&symfile_complaints,
_("file index out of range"));
- else
+ else if (file_index > 0)
{
struct file_entry *fe;
fe = &cu->line_header->file_names[file_index - 1];