From 24a550149d4e29a9285b420d27bc0b2b487b802a Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Fri, 9 Aug 2013 17:26:40 +0000 Subject: [PATCH 1/1] * dwarf2read.c (create_addrmap_from_index): Ignore bad address table entries. --- gdb/ChangeLog | 5 +++++ gdb/dwarf2read.c | 15 +++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 9e99003ca6..bea378f0f1 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2013-08-09 Doug Evans + + * dwarf2read.c (create_addrmap_from_index): Ignore bad address table + entries. + 2013-08-09 Sergio Durigan Junior * linux-tdep.c: Define enum with generic signal numbers. diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 9e19e78fda..54a6dfbdb4 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -2570,17 +2570,24 @@ create_addrmap_from_index (struct objfile *objfile, struct mapped_index *index) cu_index = extract_unsigned_integer (iter, 4, BFD_ENDIAN_LITTLE); iter += 4; - if (cu_index < dwarf2_per_objfile->n_comp_units) + if (lo > hi) { - addrmap_set_empty (mutable_map, lo + baseaddr, hi + baseaddr - 1, - dw2_get_cu (cu_index)); + complaint (&symfile_complaints, + _(".gdb_index address table has invalid range (%s - %s)"), + pulongest (lo), pulongest (hi)); + continue; } - else + + if (cu_index >= dwarf2_per_objfile->n_comp_units) { complaint (&symfile_complaints, _(".gdb_index address table has invalid CU number %u"), (unsigned) cu_index); + continue; } + + addrmap_set_empty (mutable_map, lo + baseaddr, hi + baseaddr - 1, + dw2_get_cu (cu_index)); } objfile->psymtabs_addrmap = addrmap_create_fixed (mutable_map, -- 2.34.1