From: Joel Brobecker Date: Fri, 4 Jan 2008 19:01:30 +0000 (+0000) Subject: * ada-lang.c (ada_evaluate_subexp): Evaluate tagged types in X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6799def48172fb4c23cd55e67faa0c9fc3b74dfb;p=binutils-gdb.git * ada-lang.c (ada_evaluate_subexp): Evaluate tagged types in EVAL_NORMAL mode when noside is EVAL_AVOID_SIDE_EFFECTS. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 6c6be45add2..82f6ae80d99 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2008-01-04 Joel Brobecker + + * ada-lang.c (ada_evaluate_subexp): Evaluate tagged types in + EVAL_NORMAL mode when noside is EVAL_AVOID_SIDE_EFFECTS. + 2008-01-04 Joel Brobecker * ada-exp.y (chop_separator): New function. diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 2c617057f17..134244f1d31 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;