[Ada] array pointers encoded as typedef to fat pointer
A recent change in check_typedef caused the following regression,
considering:
type String_Access is access String;
S1 : String_Access := null;
Trying to print S1, we get:
(gdb) print s1
$1 = (string) (null)
The type name is wrong. We were expecting:
(gdb) print s1
$1 = (string_bug.string_access) (null)
The extensive comment in this patch explains how pointers to arrays
are encoded when the array is a "fat pointer". What happened is
that the change in check_typedef broke a type-equality test that
we were performing. The test really was on the fringe, but it
turns out that, for what we're doing, we're really only interested
in the main-type portion of the type.
The patch adjust the check accordingly.
gdb/ChangeLog:
* ada-lang.c (ada_to_fixed_type): Expand function documentation.
Return the original type if the main type portions match rather
than when the type themselves match.