An earlier patch in the "nameless" series caused a regression with
-fgnat-encodings=all. Previously, all artificial types were emitted
in the CU scope in the DWARF, but with the patch, an "XUB" type is
emitted in the function scope. This causes gdb lookups to erroneously
find the XUB type rather than the type that gdb expects to find.
Note that I don't know why the earlier code worked, because decl.cc
clearly sets the XUB type's context to be the current function.
This patch changes the type's context so that it is nested in a type
that is conveniently available.
gcc/ada/ChangeLog:
* gcc-interface/decl.cc (gnat_to_gnu_entity): Use gnu_fat_type as the type
context for a XUB type.
= chainon (gnu_template_fields, gnu_temp_fields[index]);
finish_record_type (gnu_template_type, gnu_template_fields, 0,
debug_info_p);
- TYPE_CONTEXT (gnu_template_type) = current_function_decl;
+ TYPE_CONTEXT (gnu_template_type) = gnu_fat_type;
/* If Component_Size is not already specified, annotate it with the
size of the component. */