Split gen_expr_binop_rest
This splits gen_expr_binop_rest into two overloads. One overload retains the "pc" parameter, while the other does not, and furthermore does not call gen_expr on the left-hand-side. This split is useful for subsequent patches in the new expression evaluation approach. gdb/ChangeLog 2021-03-08 Tom Tromey <tom@tromey.com> * ax-gdb.c (gen_expr_binop_rest): Remove "pc" parameter. (gen_expr_binop_rest): New overload.
This commit is contained in:
parent
c0d7ed8ca8
commit
e18c58f290
2 changed files with 19 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
|
* ax-gdb.c (gen_expr_binop_rest): Remove "pc" parameter.
|
||||||
|
(gen_expr_binop_rest): New overload.
|
||||||
|
|
||||||
2021-03-08 Tom Tromey <tom@tromey.com>
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
* eval.c (eval_multi_subscript): New function.
|
* eval.c (eval_multi_subscript): New function.
|
||||||
|
|
16
gdb/ax-gdb.c
16
gdb/ax-gdb.c
|
@ -2276,13 +2276,12 @@ gen_expr (struct expression *exp, union exp_element **pc,
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gen_expr_binop_rest (struct expression *exp,
|
gen_expr_binop_rest (struct expression *exp,
|
||||||
enum exp_opcode op, union exp_element **pc,
|
enum exp_opcode op,
|
||||||
struct agent_expr *ax, struct axs_value *value,
|
struct agent_expr *ax, struct axs_value *value,
|
||||||
struct axs_value *value1, struct axs_value *value2)
|
struct axs_value *value1, struct axs_value *value2)
|
||||||
{
|
{
|
||||||
struct type *int_type = builtin_type (ax->gdbarch)->builtin_int;
|
struct type *int_type = builtin_type (ax->gdbarch)->builtin_int;
|
||||||
|
|
||||||
gen_expr (exp, pc, ax, value2);
|
|
||||||
gen_usual_unary (ax, value2);
|
gen_usual_unary (ax, value2);
|
||||||
gen_usual_arithmetic (ax, value1, value2);
|
gen_usual_arithmetic (ax, value1, value2);
|
||||||
switch (op)
|
switch (op)
|
||||||
|
@ -2420,6 +2419,19 @@ gen_expr_binop_rest (struct expression *exp,
|
||||||
_("gen_expr: op case sets don't match"));
|
_("gen_expr: op case sets don't match"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Variant of gen_expr_binop_rest that first generates the
|
||||||
|
right-hand-side. */
|
||||||
|
|
||||||
|
static void
|
||||||
|
gen_expr_binop_rest (struct expression *exp,
|
||||||
|
enum exp_opcode op, union exp_element **pc,
|
||||||
|
struct agent_expr *ax, struct axs_value *value,
|
||||||
|
struct axs_value *value1, struct axs_value *value2)
|
||||||
|
{
|
||||||
|
gen_expr (exp, pc, ax, value2);
|
||||||
|
gen_expr_binop_rest (exp, op, ax, value, value1, value2);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Given a single variable and a scope, generate bytecodes to trace
|
/* Given a single variable and a scope, generate bytecodes to trace
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue