summaryrefslogtreecommitdiff
path: root/gdb/expop.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:20 -0700
commitd4eff4c122e06e913452e2039e29e8db6b15b1dd (patch)
tree947f955e0c6857fae0edb7d26cb9d0e86f594daf /gdb/expop.h
parent46916f2bcbaf4532aab9fecb2344330710129ffa (diff)
downloadbinutils-gdb-d4eff4c122e06e913452e2039e29e8db6b15b1dd.tar.gz
Introduce repeat_operation
This adds class repeat_operation, which implements BINOP_REPEAT. gdb/ChangeLog 2021-03-08 Tom Tromey <tom@tromey.com> * expop.h (class repeat_operation): New. * eval.c (eval_op_repeat): No longer static. Remove "op" parameter. (evaluate_subexp_standard): Update. * ax-gdb.c (repeat_operation::do_generate_ax): New method.
Diffstat (limited to 'gdb/expop.h')
-rw-r--r--gdb/expop.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/gdb/expop.h b/gdb/expop.h
index af378d011f8..4bf32f538e1 100644
--- a/gdb/expop.h
+++ b/gdb/expop.h
@@ -135,6 +135,11 @@ extern struct value *eval_op_leq (struct type *expect_type,
enum noside noside, enum exp_opcode op,
struct value *arg1,
struct value *arg2);
+extern struct value *eval_op_repeat (struct type *expect_type,
+ struct expression *exp,
+ enum noside noside, enum exp_opcode op,
+ struct value *arg1,
+ struct value *arg2);
namespace expr
{
@@ -1188,6 +1193,21 @@ using gtr_operation = comparison_operation<BINOP_GTR, eval_op_gtr>;
using geq_operation = comparison_operation<BINOP_GEQ, eval_op_geq>;
using leq_operation = comparison_operation<BINOP_LEQ, eval_op_leq>;
+/* Implement the GDB '@' repeat operator. */
+class repeat_operation
+ : public binop_operation<BINOP_REPEAT, eval_op_repeat>
+{
+ using binop_operation<BINOP_REPEAT, eval_op_repeat>::binop_operation;
+
+protected:
+
+ void do_generate_ax (struct expression *exp,
+ struct agent_expr *ax,
+ struct axs_value *value,
+ struct type *cast_type)
+ override;
+};
+
} /* namespace expr */
#endif /* EXPOP_H */