From 876469ffa1f52b15dfbc8336b31b908edf95fba6 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 8 Mar 2021 07:27:57 -0700 Subject: Introduce unop_ind_operation This adds class unop_ind_operation, which implements UNOP_IND. gdb/ChangeLog 2021-03-08 Tom Tromey * expop.h (class unop_ind_base_operation) (class unop_ind_operation): New. * eval.c (eval_op_ind): No longer static. Remove "op" parameter. (unop_ind_base_operation::evaluate_for_address) (unop_ind_base_operation::evaluate_for_sizeof): New method. * ax-gdb.c (gen_expr_unop) : New. --- gdb/ax-gdb.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'gdb/ax-gdb.c') diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c index c87b290..f7ab50f 100644 --- a/gdb/ax-gdb.c +++ b/gdb/ax-gdb.c @@ -2736,6 +2736,14 @@ gen_expr_unop (struct expression *exp, gen_complement (ax, value); break; + case UNOP_IND: + lhs->generate_ax (exp, ax, value); + gen_usual_unary (ax, value); + if (!pointer_type (value->type)) + error (_("Argument of unary `*' is not a pointer.")); + gen_deref (value); + break; + default: gdb_assert_not_reached ("invalid case in gen_expr_unop"); } -- cgit v1.1