Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [ob] Fix dwarf2 reader crash
@ 2007-01-28 14:42 Mark Kettenis
  2007-01-28 14:44 ` Daniel Jacobowitz
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Kettenis @ 2007-01-28 14:42 UTC (permalink / raw)
  To: gdb-patches

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];


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ob] Fix dwarf2 reader crash
  2007-01-28 14:42 [ob] Fix dwarf2 reader crash Mark Kettenis
@ 2007-01-28 14:44 ` Daniel Jacobowitz
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Jacobowitz @ 2007-01-28 14:44 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: gdb-patches

On Sun, Jan 28, 2007 at 03:42:29PM +0100, Mark Kettenis wrote:
> DW_AT_decl_file can be zero, indicating no file.  It's better not to
> crash in that case.

Whoops, thank you!

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-01-28 14:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-28 14:42 [ob] Fix dwarf2 reader crash Mark Kettenis
2007-01-28 14:44 ` Daniel Jacobowitz

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