diff options
Diffstat (limited to 'gdb/ada-lang.c')
-rw-r--r-- | gdb/ada-lang.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index e63cf88..4f77600 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -7788,11 +7788,20 @@ ada_get_base_type (struct type *raw_type) || TYPE_NFIELDS (real_type_namer) != 1) return raw_type; - raw_real_type = ada_find_any_type (TYPE_FIELD_NAME (real_type_namer, 0)); - if (raw_real_type == NULL) - return raw_type; - else - return raw_real_type; + if (TYPE_CODE (TYPE_FIELD_TYPE (real_type_namer, 0)) != TYPE_CODE_REF) + { + /* This is an older encoding form where the base type needs to be + looked up by name. We prefer the newer enconding because it is + more efficient. */ + raw_real_type = ada_find_any_type (TYPE_FIELD_NAME (real_type_namer, 0)); + if (raw_real_type == NULL) + return raw_type; + else + return raw_real_type; + } + + /* The field in our XVS type is a reference to the base type. */ + return TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (real_type_namer, 0)); } /* The type of value designated by TYPE, with all aligners removed. */ |