When displaying ranges, ignore duplicate offsets.
* dwarf.c (display_debug_ranges): Ignore duplicate entries in range_entries for the same offset.
This commit is contained in:
parent
241e541d00
commit
cb4c35cfbe
@ -1,3 +1,8 @@
|
|||||||
|
2020-04-29 Andrew Burgess <andrew.burgess@embecosm.com>
|
||||||
|
|
||||||
|
* dwarf.c (display_debug_ranges): Ignore duplicate entries in
|
||||||
|
range_entries for the same offset.
|
||||||
|
|
||||||
2020-04-29 Nick Clifton <nickc@redhat.com>
|
2020-04-29 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
* readelf.c (warn): New function - like elfcomm.c version but only
|
* readelf.c (warn): New function - like elfcomm.c version but only
|
||||||
|
@ -6923,6 +6923,7 @@ display_debug_ranges (struct dwarf_section *section,
|
|||||||
int is_rnglists = strstr (section->name, "debug_rnglists") != NULL;
|
int is_rnglists = strstr (section->name, "debug_rnglists") != NULL;
|
||||||
/* Initialize it due to a false compiler warning. */
|
/* Initialize it due to a false compiler warning. */
|
||||||
unsigned char address_size = 0;
|
unsigned char address_size = 0;
|
||||||
|
dwarf_vma last_offset = 0;
|
||||||
|
|
||||||
if (bytes == 0)
|
if (bytes == 0)
|
||||||
{
|
{
|
||||||
@ -7078,6 +7079,15 @@ display_debug_ranges (struct dwarf_section *section,
|
|||||||
continue;
|
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 (dwarf_check != 0 && i > 0)
|
||||||
{
|
{
|
||||||
if (start < next)
|
if (start < next)
|
||||||
|
Loading…
Reference in New Issue
Block a user