crash when printing type of tagged type
If the debugging info is incorrect or incomplete, printing the
type description of a variable that's a variant tagged type can
trigger a crash. The crash comes from us trying print a NULL
string which was supposed to be the parent type name.
We observed this behavior on bareboard targets where a-tags is
not always linked in, as is the case for native platforms, for
instance. Coupled with -feliminate-unused-debug-types, this leads
to GDB being unable to find type ada__tags__type_specific_data,
without which printing the type description above cannot be done
acurately. There is an easy workaround for this limitation,
which is to compile at least 1 unit with
-fno-eliminate-unused-debug-types, but GDB should also be made
resilient to this situation.
gdb/ChangeLog:
* ada-typeprint.c (print_record_type): If unable to decode
the name of the parent type, use the encoded name.