diff options
author | Tom Tromey <tom@tromey.com> | 2021-03-08 07:27:57 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2021-03-08 07:28:21 -0700 |
commit | 876469ffa1f52b15dfbc8336b31b908edf95fba6 (patch) | |
tree | 529d3b4adac4c544c72ca41c199415aa543bb943 /gdb/ax-gdb.c | |
parent | 6d89e2962a8cc245b8364e1968396873bd0bb9b1 (diff) | |
download | gdb-876469ffa1f52b15dfbc8336b31b908edf95fba6.zip gdb-876469ffa1f52b15dfbc8336b31b908edf95fba6.tar.gz gdb-876469ffa1f52b15dfbc8336b31b908edf95fba6.tar.bz2 |
Introduce unop_ind_operation
This adds class unop_ind_operation, which implements UNOP_IND.
gdb/ChangeLog
2021-03-08 Tom Tromey <tom@tromey.com>
* 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) <case UNOP_IND>: New.
Diffstat (limited to 'gdb/ax-gdb.c')
-rw-r--r-- | gdb/ax-gdb.c | 8 |
1 files changed, 8 insertions, 0 deletions
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"); } |