summaryrefslogtreecommitdiff
path: root/gdb/ada-lang.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2010-02-09 13:15:09 +0000
committerJoel Brobecker <brobecker@gnat.com>2010-02-09 13:15:09 +0000
commit5ba43a191ed2760adddffc9d397b86b48854f59a (patch)
tree35eaf8495d4ee1d8c74f652e5179f9c81fb47dda /gdb/ada-lang.c
parent29ec348b84e9a2ed8fafce6a2e5eb9e1bddfa7bc (diff)
downloadgdb-5ba43a191ed2760adddffc9d397b86b48854f59a.tar.gz
Wrong type description for tagged type parameter.
* ada-lang.c (ada_evaluate_subexp) [OP_VAR_VALUE]: When noside is EVAL_AVOID_SIDE_EFFECTS, also handle the case when type is a reference to a tagged type.
Diffstat (limited to 'gdb/ada-lang.c')
-rw-r--r--gdb/ada-lang.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 40b70ab5cc7..7a2d2ca84e1 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -8906,7 +8906,14 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
else if (noside == EVAL_AVOID_SIDE_EFFECTS)
{
type = static_unwrap_type (SYMBOL_TYPE (exp->elts[pc + 2].symbol));
- if (ada_is_tagged_type (type, 0))
+ /* Check to see if this is a tagged type. We also need to handle
+ the case where the type is a reference to a tagged type, but
+ we have to be careful to exclude pointers to tagged types.
+ The latter should be shown as usual (as a pointer), whereas
+ a reference should mostly be transparent to the user. */
+ if (ada_is_tagged_type (type, 0)
+ || (TYPE_CODE(type) == TYPE_CODE_REF
+ && ada_is_tagged_type (TYPE_TARGET_TYPE (type), 0)))
{
/* Tagged types are a little special in the fact that the real
type is dynamic and can only be determined by inspecting the