[PATCH] gdb: fix regression in copy_type_recursive

Tom Tromey tom@tromey.com
Sat Jan 23 20:38:20 GMT 2021


>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:

Simon> get_type_arch and type->arch isn't the same thing: get_type_arch gets
Simon> the type's arch owner if it is arch-owned, and gets the objfile's arch
Simon> if the type is objfile owned.  So it always returns non-NULL.
type-> arch returns the type's arch if the type is arch-owned, else NULL.

This seems like something to fix in the longer term.
Is there a good reason for type::arch to work this way?

Simon> Fix this by using get_type_arch again there.

Thanks, I think this will fix the gdb.compile failures I'm seeing.
It looks good to me.

Tom


More information about the Gdb-patches mailing list