[PATCH, v2][gdb/symtab] Force usage of all_comp_units.size (CU/TU/CUTU)

Tom de Vries tdevries@suse.de
Thu Jul 21 11:20:52 GMT 2022


[ was: Re: [committed][gdb/symtab] Fix bad compile unit index complaint ]

On 7/21/22 13:10, Tom de Vries wrote:
> [ was: Re: [PATCH][gdb/symtab] Force usage of all_comp_units.size 
> (CU/TU/CUTU) ]
> 
> On 7/14/22 16:43, Tom de Vries wrote:
>> Hi,
>>
>> I noticed this code in dw2_debug_names_iterator::next:
>> ...
>>          case DW_IDX_compile_unit:
>>            /* Don't crash on bad data.  */
>>            if (ull >= per_bfd->all_comp_units.size ())
>>              {
>>                complaint (_(".debug_names entry has bad CU index %s"
>>                             " [in module %s]"),
>>                           pulongest (ull),
>>                           objfile_name (objfile));
>>                continue;
>>              }
>>            per_cu = per_bfd->get_cu (ull);
>>            break;
>> ...
>>
>> This code used to DTRT, before we started keeping both CUs and TUs in
>> all_comp_units.
>>
> 
> I've dropped the all_comp_units.size (CU/TU/CUTU) part, since that 
> somewhat violates the One-Patch-Per-Independent=Change rule.

And here is it, independent of the dw2_debug_names_iterator::next issue.

Thanks,
- Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-gdb-symtab-Force-usage-of-all_comp_units.size-CU-TU-CUTU.patch
Type: text/x-patch
Size: 13233 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/gdb-patches/attachments/20220721/cfa7cc3b/attachment-0001.bin>


More information about the Gdb-patches mailing list