[PATCH][binutils] Handle presence of both .debug_ranges and .debug_rnglists

Tom de Vries tdevries@suse.de
Wed Feb 10 09:42:12 GMT 2021


[ was: Re: [PATCH][binutils] Fix debug_rnglists test in
display_debug_ranges ]
On 2/10/21 4:54 AM, Alan Modra wrote:
> On Tue, Feb 09, 2021 at 05:56:54PM +0100, Tom de Vries wrote:
>> --- a/binutils/dwarf.c
>> +++ b/binutils/dwarf.c
>> @@ -7581,7 +7581,7 @@ display_debug_ranges (struct dwarf_section *section,
>>    unsigned char *finish = start + bytes;
>>    unsigned int num_range_list, i;
>>    struct range_entry *range_entries, *range_entry_fill;
>> -  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.  */
>>    unsigned char address_size = 0;
>>    dwarf_vma last_offset = 0;
> 
> I must be having a slow brain day, but I don't see what the above is
> doing besides making .zdebug_rnglists not match.  Isn't the whole
> point of using strstr here to allow the compressed section prefix?
> 

Hi Alan,

thanks for the review.

You're right, this modification is not necessary to fix the problem, and
it has the problematic effect you describe here.

It seems my mind was convinced this was a strcmp...

Fixed in updated patch.  Updated $subject accordingly.

OK for trunk?

Thanks,
- Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-binutils-Handle-presence-of-both-.debug_ranges-and-.debug_rnglists.patch
Type: text/x-patch
Size: 2189 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20210210/54c02175/attachment-0001.bin>


More information about the Binutils mailing list