aboutsummaryrefslogtreecommitdiff
path: root/gdb/ada-exp.h
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-exp.h
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-exp.h')
-rw-r--r--gdb/ada-exp.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/gdb/ada-exp.h b/gdb/ada-exp.h
index 07744c1..c86b054 100644
--- a/gdb/ada-exp.h
+++ b/gdb/ada-exp.h
@@ -69,6 +69,9 @@ extern struct value *ada_pos_atr (struct type *expect_type,
struct expression *exp,
enum noside noside, enum exp_opcode op,
struct value *arg);
+extern struct value *ada_val_atr (enum noside noside, struct type *type,
+ struct value *arg);
+
namespace expr
{
@@ -334,6 +337,22 @@ protected:
using operation::do_generate_ax;
};
+/* Implement the Ada 'val attribute. */
+class ada_atr_val_operation
+ : public tuple_holding_operation<struct type *, operation_up>
+{
+public:
+
+ using tuple_holding_operation::tuple_holding_operation;
+
+ value *evaluate (struct type *expect_type,
+ struct expression *exp,
+ enum noside noside) override;
+
+ enum exp_opcode opcode () const override
+ { return OP_ATR_VAL; }
+};
+
} /* namespace expr */
#endif /* ADA_EXP_H */