Re: [PATCH] Dwarf 5: Handle debug_str_offsets and indexed attributes that have base offsets.

Simon Marchi
2020-01-11T13:35:03Z

On 2020-01-10 10:45 p.m., Ali Tamur via gdb-patches wrote:
>> Could this be
>> cu->addr_base = lookup_addr_base (die);
> gdb.dwarf2/fission-base.exp consistently failed when I tried your suggestion,
> and now I am scared whether it is a safe change. (I don't understand the
> control flow well, but if cu->addr_base was assigned previously and
> lookup_addr_base fails, it would unassign the previous value.

Yeah, I'm not sure either. I'm fairly confident that if, for some reason,
the field is already set, then it would set it to the same value. After all,
stub_comp_unit_die is the stub DIE that corresponds to the DWO file we
are reading. If for some reason, there is already a value in cu->addr_base,
then it must come from this DIE.

If your tests pass, I think we can leave it like this, but of course that can
be changed if that proves to be wrong.

>> what is the reason we need to have two separate loops here again?
> Converted to a single loop.
>
>> What happens if we encounter one these indirect string forms (strx and
>> company) here, but we don't enter any of the two "if" clauses above?
> I think that means an incorrect DWARF; I removed the if condition, so the
> complaint in read_stub_str_index will trigger.

Ok, that's fine with me, it will error out immediatly in that case.

The patch LGTM, but I think we are just missing a ChangeLog entry?

Simon