[PATCH v3.2 2/5] DWARF-5: .debug_names index producer

Simon Marchi simon.marchi@ericsson.com
Sun Dec 31 03:52:00 GMT 2017


On 2017-12-08 06:51 PM, Pedro Alves wrote:
>> +static bool
>> +check_dwarf64_offsets ()
>> +{
>> +  for (int i = 0; i < dwarf2_per_objfile->n_comp_units; ++i)
>> +    {
>> +      const dwarf2_per_cu_data &per_cu (*dwarf2_per_objfile->all_comp_units[i]);
>> +
>> +      if (to_underlying (per_cu.sect_off) >= (static_cast<uint64_t> (1) << 32))
>> +	return true;
>> +    }
>> +  for (int i = 0; i < dwarf2_per_objfile->n_type_units; ++i)
>> +    {
>> +      const signatured_type &sigtype (*dwarf2_per_objfile->all_type_units[i]);
>> +      const dwarf2_per_cu_data &per_cu (sigtype.per_cu);
>> +
>> +      if (to_underlying (per_cu.sect_off) >= (static_cast<uint64_t> (1) << 32))
>> +	return true;
> These look like always return false, since per_cu.sect_off is 32-bit?
> I've left it as is, but it doesn't look right to me.  Seems like
> that makes all the 64-bit support dead as is.

Clang indeed complains about this tautology.

I made a patch that makes sect_offset 64-bits, if you want to take a look:
https://sourceware.org/ml/gdb-patches/2017-12/msg00530.html

Simon



More information about the Gdb-patches mailing list