* dwarf2read.c (dwarf2_symbol_mark_computed): Handle corrupted
authorDaniel Jacobowitz <drow@false.org>
Wed, 12 Jul 2006 21:14:57 +0000 (21:14 +0000)
committerDaniel Jacobowitz <drow@false.org>
Wed, 12 Jul 2006 21:14:57 +0000 (21:14 +0000)
or missing location list information.  Suggested by Jan
Kratochvil <lace@jankratochvil.net>.

gdb/ChangeLog
gdb/dwarf2read.c

index 22d2bb0bf6170c3a9ca470928c3c4acda899e398..3652bd209927107e0a6feb852a2fbde08c86b65b 100644 (file)
@@ -1,3 +1,9 @@
+2006-07-12  Daniel Jacobowitz  <dan@codesourcery.com>
+
+       * dwarf2read.c (dwarf2_symbol_mark_computed): Handle corrupted
+       or missing location list information.  Suggested by Jan
+       Kratochvil <lace@jankratochvil.net>.
+
 2006-07-12  Daniel Jacobowitz  <dan@codesourcery.com>
 
        * Makefile.in (arm_linux_tdep_h): New variable.
index bcd796f23009d151fdf2f068376620db0a4c41df..934ee01c5d66c53c7c464c428822f9c7638c7774 100644 (file)
@@ -9324,7 +9324,11 @@ static void
 dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym,
                             struct dwarf2_cu *cu)
 {
-  if (attr->form == DW_FORM_data4 || attr->form == DW_FORM_data8)
+  if ((attr->form == DW_FORM_data4 || attr->form == DW_FORM_data8)
+      /* ".debug_loc" may not exist at all, or the offset may be outside
+        the section.  If so, fall through to the complaint in the
+        other branch.  */
+      && DW_UNSND (attr) < dwarf2_per_objfile->loc_size)
     {
       struct dwarf2_loclist_baton *baton;