aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2010-01-18 10:26:02 +0000
committerJoel Brobecker <brobecker@gnat.com>2010-01-18 10:26:02 +0000
commitf80d3ff275e070708f87ed2bc25fbf35b6e1b8cc (patch)
tree227108b74702283da0a1ce7c47400c09c3dc1982 /gdb
parent5bf03f13872d723bf34d63d622cf277eb76523e7 (diff)
downloadgdb-f80d3ff275e070708f87ed2bc25fbf35b6e1b8cc.zip
gdb-f80d3ff275e070708f87ed2bc25fbf35b6e1b8cc.tar.gz
gdb-f80d3ff275e070708f87ed2bc25fbf35b6e1b8cc.tar.bz2
Use XVS field type instead of doing a parallel lookup.
* ada-lang.c (ada_get_base_type): Follow the XVS field type if it is a reference type instead of doing a type lookup using the XVS field name.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/ada-lang.c19
2 files changed, 21 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 505b097..2eb2297 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,12 @@
2010-01-18 Joel Brobecker <brobecker@adacore.com>
+ Use XVS field type instead of doing a parallel lookup.
+ * ada-lang.c (ada_get_base_type): Follow the XVS field type
+ if it is a reference type instead of doing a type lookup using
+ the XVS field name.
+
+2010-01-18 Joel Brobecker <brobecker@adacore.com>
+
Trust PAD types instead of using PAD___XVS.
* ada-lang.c (trust_pad_over_xvs): New static variable.
(ada_is_aligner_type): If !trust_pad_over_xvs and there is a
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. */