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:15 -0700 |
commit | b5cc3923def975c28d44421a11bac671ede5b92c (patch) | |
tree | 3a747279438190fc11517dc09d390ea85e2278d8 | |
parent | 0c8effa32e9326ca80f3e7cd74635e1dc44b3db5 (diff) | |
download | gdb-b5cc3923def975c28d44421a11bac671ede5b92c.zip gdb-b5cc3923def975c28d44421a11bac671ede5b92c.tar.gz gdb-b5cc3923def975c28d44421a11bac671ede5b92c.tar.bz2 |
Introduce var_entry_value_operation
This adds class var_entry_value_operation, which implements
OP_VAR_ENTRY_VALUE.
gdb/ChangeLog
2021-03-08 Tom Tromey <tom@tromey.com>
* expop.h (class var_entry_value_operation): New.
* eval.c (eval_op_var_entry_value): No longer static.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/eval.c | 2 | ||||
-rw-r--r-- | gdb/expop.h | 22 |
3 files changed, 28 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 129a238..f35cb4b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2021-03-08 Tom Tromey <tom@tromey.com> + * expop.h (class var_entry_value_operation): New. + * eval.c (eval_op_var_entry_value): No longer static. + +2021-03-08 Tom Tromey <tom@tromey.com> + * expression.h (class operation) <set_outermost>: New method. * expop.h (class var_msym_value_operation): New. * eval.c (eval_op_var_msym_value): No longer static. @@ -1201,7 +1201,7 @@ eval_op_scope (struct type *expect_type, struct expression *exp, /* Helper function that implements the body of OP_VAR_ENTRY_VALUE. */ -static struct value * +struct value * eval_op_var_entry_value (struct type *expect_type, struct expression *exp, enum noside noside, symbol *sym) { diff --git a/gdb/expop.h b/gdb/expop.h index 345cac2..033ea0b 100644 --- a/gdb/expop.h +++ b/gdb/expop.h @@ -51,6 +51,9 @@ extern struct value *eval_op_var_msym_value (struct type *expect_type, bool outermost_p, minimal_symbol *msymbol, struct objfile *objfile); +extern struct value *eval_op_var_entry_value (struct type *expect_type, + struct expression *exp, + enum noside noside, symbol *sym); namespace expr { @@ -533,6 +536,25 @@ protected: override; }; +class var_entry_value_operation + : public tuple_holding_operation<symbol *> +{ +public: + + using tuple_holding_operation::tuple_holding_operation; + + value *evaluate (struct type *expect_type, + struct expression *exp, + enum noside noside) override + { + return eval_op_var_entry_value (expect_type, exp, noside, + std::get<0> (m_storage)); + } + + enum exp_opcode opcode () const override + { return OP_VAR_ENTRY_VALUE; } +}; + } /* namespace expr */ #endif /* EXPOP_H */ |