From: Joel Brobecker Date: Thu, 20 Jul 2006 16:17:18 +0000 (+0000) Subject: * dwarf2read.c (dwarf2_symbol_mark_computed): Handle corrupted X-Git-Tag: insight_6_5-20061003-release~76 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a23d1ad78b11e20b93302684f7f1540e63038eb4;p=thirdparty%2Fbinutils-gdb.git * dwarf2read.c (dwarf2_symbol_mark_computed): Handle corrupted or missing location list information. Suggested by Jan Kratochvil . --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0a59c338a0a..80864d7b55f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2006-07-20 Daniel Jacobowitz + + * dwarf2read.c (dwarf2_symbol_mark_computed): Handle corrupted + or missing location list information. Suggested by Jan + Kratochvil . + 2006-07-13 Denis PILAT * interps.c (interpreter_completer): Allocate one more item to the diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 31b0ae0b65b..5324329dcd9 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -9304,7 +9304,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;