aboutsummaryrefslogtreecommitdiff
path: root/gdb/ada-lang.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/ada-lang.c')
-rw-r--r--gdb/ada-lang.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index a9b5e6f..c4e85d2 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -10185,8 +10185,22 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
}
}
- *pos += 4;
- return value_zero (to_static_fixed_type (type), not_lval);
+ /* Records and unions for which GNAT encodings have been
+ generated need to be statically fixed as well.
+ Otherwise, non-static fixing produces a type where
+ all dynamic properties are removed, which prevents "ptype"
+ from being able to completely describe the type.
+ For instance, a case statement in a variant record would be
+ replaced by the relevant components based on the actual
+ value of the discriminants. */
+ if ((TYPE_CODE (type) == TYPE_CODE_STRUCT
+ && dynamic_template_type (type) != NULL)
+ || (TYPE_CODE (type) == TYPE_CODE_UNION
+ && ada_find_parallel_type (type, "___XVU") != NULL))
+ {
+ *pos += 4;
+ return value_zero (to_static_fixed_type (type), not_lval);
+ }
}
arg1 = evaluate_subexp_standard (expect_type, exp, pos, noside);