Re: [PATCH 12/20] Remove DW_ADDR

Simon Marchi
2020-03-30T15:40:34Z

On 2020-03-28 3:22 p.m., Tom Tromey wrote:
> @@ -202,6 +203,17 @@ struct attribute
> requires_reprocessing = 1;
> }
>
> + /* Set this attribute to an address. */
> + void set_address (CORE_ADDR addr)
> + {
> + gdb_assert (form == DW_FORM_addr
> + || ((form == DW_FORM_addrx
> + || form == DW_FORM_GNU_addr_index)
> + && requires_reprocessing));

I wonder if we should assert

gdb_assert (!requires_reprocessing);

in attribute::address and attribute::string. Otherwise, we could miss
reprocessing an attribute and we'd return a bogus value, it seems.

Simon