diff options
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/dwarf2read.c | 27 |
2 files changed, 32 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 95ab563..9622483 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2011-02-04 Ulrich Weigand <ulrich.weigand@linaro.org> + + * dwarf2read.c (dwarf2_ranges_read): Skip empty range entries. + Complain about inverted range entries. + (dwarf2_record_block_ranges): Likewise. + 2011-02-04 Thiago Jung Bauermann <bauerman@br.ibm.com> Fix some typos. diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 6a98d57..bc43bd8 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -5863,10 +5863,22 @@ dwarf2_ranges_read (unsigned offset, CORE_ADDR *low_return, return 0; } + if (range_beginning > range_end) + { + /* Inverted range entries are invalid. */ + complaint (&symfile_complaints, + _("Invalid .debug_ranges data (inverted range)")); + return 0; + } + + /* Empty range entries have no effect. */ + if (range_beginning == range_end) + continue; + range_beginning += base; range_end += base; - if (ranges_pst != NULL && range_beginning < range_end) + if (ranges_pst != NULL) addrmap_set_empty (objfile->psymtabs_addrmap, range_beginning + baseaddr, range_end - 1 + baseaddr, @@ -6149,6 +6161,19 @@ dwarf2_record_block_ranges (struct die_info *die, struct block *block, return; } + if (start > end) + { + /* Inverted range entries are invalid. */ + complaint (&symfile_complaints, + _("Invalid .debug_ranges data " + "(inverted range)")); + return; + } + + /* Empty range entries have no effect. */ + if (start == end) + continue; + record_block_range (block, baseaddr + base + start, baseaddr + base + end - 1); |