aboutsummaryrefslogtreecommitdiff
path: root/gdb/ada-lang.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2021-03-08 07:27:57 -0700
committerTom Tromey <tom@tromey.com>2021-03-08 07:28:35 -0700
commit9e99f48f27790c43d5fd663c9eb4c3a19ae49efa (patch)
tree7be2a4a52c7744deea83464c9ed4a0dd604babe1 /gdb/ada-lang.c
parent7631cf6cc8812fef7d27aff800e12f8e31393f29 (diff)
downloadgdb-9e99f48f27790c43d5fd663c9eb4c3a19ae49efa.zip
gdb-9e99f48f27790c43d5fd663c9eb4c3a19ae49efa.tar.gz
gdb-9e99f48f27790c43d5fd663c9eb4c3a19ae49efa.tar.bz2
Introduce ada_atr_val_operation
This adds class ada_atr_val_operation, which implements OP_ATR_VAL. gdb/ChangeLog 2021-03-08 Tom Tromey <tom@tromey.com> * ada-lang.c (ada_val_atr): No longer static. (ada_atr_val_operation::evaluate): New method. * ada-exp.h (class ada_atr_val_operation): New.
Diffstat (limited to 'gdb/ada-lang.c')
-rw-r--r--gdb/ada-lang.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 52766ae..c689c7f 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -8892,7 +8892,7 @@ val_atr (struct type *type, LONGEST val)
return value_from_longest (type, val);
}
-static struct value *
+struct value *
ada_val_atr (enum noside noside, struct type *type, struct value *arg)
{
if (noside == EVAL_AVOID_SIDE_EFFECTS)
@@ -10694,6 +10694,15 @@ ada_var_value_operation::evaluate (struct type *expect_type,
return ada_to_fixed_value (arg1);
}
+value *
+ada_atr_val_operation::evaluate (struct type *expect_type,
+ struct expression *exp,
+ enum noside noside)
+{
+ value *arg = std::get<1> (m_storage)->evaluate (nullptr, exp, noside);
+ return ada_val_atr (noside, std::get<0> (m_storage), arg);
+}
+
}
/* Implement the evaluate_exp routine in the exp_descriptor structure