diff options
author | Doug Evans <dje@google.com> | 2013-08-09 17:26:40 +0000 |
---|---|---|
committer | Doug Evans <dje@google.com> | 2013-08-09 17:26:40 +0000 |
commit | 24a550149d4e29a9285b420d27bc0b2b487b802a (patch) | |
tree | cd88c16e25f40676b253e7185124789bba78318b /gdb/dwarf2read.c | |
parent | eb14d4068893a301911485d732b4ae961c34e532 (diff) | |
download | gdb-24a550149d4e29a9285b420d27bc0b2b487b802a.zip gdb-24a550149d4e29a9285b420d27bc0b2b487b802a.tar.gz gdb-24a550149d4e29a9285b420d27bc0b2b487b802a.tar.bz2 |
* dwarf2read.c (create_addrmap_from_index): Ignore bad address table
entries.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r-- | gdb/dwarf2read.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 9e19e78..54a6dfb 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, |