From 99bcc461a52376e6b5c0fb0fa488964f8ff18b1a Mon Sep 17 00:00:00 2001 From: Daniel Jacobowitz Date: Wed, 12 Jul 2006 21:14:57 +0000 Subject: [PATCH] * dwarf2read.c (dwarf2_symbol_mark_computed): Handle corrupted or missing location list information. Suggested by Jan Kratochvil . --- gdb/ChangeLog | 6 ++++++ gdb/dwarf2read.c | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 22d2bb0bf6..3652bd2099 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2006-07-12 Daniel Jacobowitz + + * dwarf2read.c (dwarf2_symbol_mark_computed): Handle corrupted + or missing location list information. Suggested by Jan + Kratochvil . + 2006-07-12 Daniel Jacobowitz * Makefile.in (arm_linux_tdep_h): New variable. diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index bcd796f230..934ee01c5d 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -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; -- 2.34.1