[PATCH] Fix Ada crash with .debug_types

Tom Tromey tromey@adacore.com
Tue Apr 28 18:59:31 GMT 2020


>>>>> "Simon" == Simon Marchi <simark@simark.ca> writes:

>> +      if (bytes == nullptr && baton == nullptr)
>> +	SET_FIELD_ENUMVAL (field, value);

Simon> What would be the consequences if this `if` turned out to be false, and we didn't
Simon> se the enum field's value?  Does that leave it in a valid state?

Hard to know.  I guess it could only happen if an enumerator value had a
block or expression form, which seems pretty unlikely.

I guess block form could happen for an enum with a 128-bit base type.
That's not handled at all by gdb though.

Simon> The code above that already checks and uses `value`, so it already assumes that
Simon> `dwarf2_const_value_attr` returned something meaningful in there.  Therefore
Simon> I don't think this last check is really useful.

I'll remove it.

Tom


More information about the Gdb-patches mailing list