aboutsummaryrefslogtreecommitdiff
path: root/gdb/ada-lang.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2008-01-04 19:01:30 +0000
committerJoel Brobecker <brobecker@gnat.com>2008-01-04 19:01:30 +0000
commit6799def48172fb4c23cd55e67faa0c9fc3b74dfb (patch)
tree33cf9740b23d4a79ac6aaa59515244f6e936a32b /gdb/ada-lang.c
parent23117009d46b41090113fdbb422ea2d0effbf538 (diff)
downloadgdb-6799def48172fb4c23cd55e67faa0c9fc3b74dfb.zip
gdb-6799def48172fb4c23cd55e67faa0c9fc3b74dfb.tar.gz
gdb-6799def48172fb4c23cd55e67faa0c9fc3b74dfb.tar.bz2
* ada-lang.c (ada_evaluate_subexp): Evaluate tagged types in
EVAL_NORMAL mode when noside is EVAL_AVOID_SIDE_EFFECTS.
Diffstat (limited to 'gdb/ada-lang.c')
-rw-r--r--gdb/ada-lang.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 2c61705..134244f 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -8339,6 +8339,15 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
case OP_VAR_VALUE:
*pos -= 1;
+
+ /* Tagged types are a little special in the fact that the real type
+ is dynamic and can only be determined by inspecting the object
+ value. So even if we're support to do an EVAL_AVOID_SIDE_EFFECTS
+ evaluation, we force an EVAL_NORMAL evaluation for tagged types. */
+ if (noside == EVAL_AVOID_SIDE_EFFECTS
+ && ada_is_tagged_type (SYMBOL_TYPE (exp->elts[pc + 2].symbol), 1))
+ noside = EVAL_NORMAL;
+
if (noside == EVAL_SKIP)
{
*pos += 4;