aboutsummaryrefslogtreecommitdiff
path: root/binutils/dwarf.c
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2020-04-29 17:21:10 +0100
committerNick Clifton <nickc@redhat.com>2020-04-29 17:21:10 +0100
commitcb4c35cfbe460c51fa13df42a56a4f811082f7eb (patch)
tree55741b1da250713fa7e6cf16c0aff2907ccd47f6 /binutils/dwarf.c
parent241e541d00a315b3de4b1e25783139a05ad9dc47 (diff)
downloadgdb-cb4c35cfbe460c51fa13df42a56a4f811082f7eb.zip
gdb-cb4c35cfbe460c51fa13df42a56a4f811082f7eb.tar.gz
gdb-cb4c35cfbe460c51fa13df42a56a4f811082f7eb.tar.bz2
When displaying ranges, ignore duplicate offsets.
* dwarf.c (display_debug_ranges): Ignore duplicate entries in range_entries for the same offset.
Diffstat (limited to 'binutils/dwarf.c')
-rw-r--r--binutils/dwarf.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index 675b4d0..eb053ce 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -6923,6 +6923,7 @@ display_debug_ranges (struct dwarf_section *section,
int is_rnglists = strstr (section->name, "debug_rnglists") != NULL;
/* Initialize it due to a false compiler warning. */
unsigned char address_size = 0;
+ dwarf_vma last_offset = 0;
if (bytes == 0)
{
@@ -7078,6 +7079,15 @@ display_debug_ranges (struct dwarf_section *section,
continue;
}
+ /* If multiple DWARF entities reference the same range then we will
+ have multiple entries in the `range_entries' list for the same
+ offset. Thanks to the sort above these will all be consecutive in
+ the `range_entries' list, so we can easily ignore duplicates
+ here. */
+ if (i > 0 && last_offset == offset)
+ continue;
+ last_offset = offset;
+
if (dwarf_check != 0 && i > 0)
{
if (start < next)