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:29 -0700 |
commit | 1c02eb30358a1d31918830b800cf1ff7c817439a (patch) | |
tree | 2fcec413594288270f0d80ffae631aff7f95f36e /gdb/expop.h | |
parent | e447908052f54164eec481d15a5274ddf385569d (diff) | |
download | gdb-1c02eb30358a1d31918830b800cf1ff7c817439a.zip gdb-1c02eb30358a1d31918830b800cf1ff7c817439a.tar.gz gdb-1c02eb30358a1d31918830b800cf1ff7c817439a.tar.bz2 |
Introduce array_operation
This adds class array_operation, which implements OP_ARRAY.
gdb/ChangeLog
2021-03-08 Tom Tromey <tom@tromey.com>
* expop.h (class array_operation): New.
* eval.c (array_operation::evaluate_struct_tuple)
(array_operation::evaluate): New methods.
Diffstat (limited to 'gdb/expop.h')
-rw-r--r-- | gdb/expop.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gdb/expop.h b/gdb/expop.h index 0785df9..9b5c4ea 100644 --- a/gdb/expop.h +++ b/gdb/expop.h @@ -2049,6 +2049,28 @@ public: { return OP_ADL_FUNC; } }; +/* The OP_ARRAY operation. */ +class array_operation + : public tuple_holding_operation<int, int, std::vector<operation_up>> +{ +public: + + using tuple_holding_operation::tuple_holding_operation; + + value *evaluate (struct type *expect_type, + struct expression *exp, + enum noside noside) override; + + enum exp_opcode opcode () const override + { return OP_ARRAY; } + +private: + + struct value *evaluate_struct_tuple (struct value *struct_val, + struct expression *exp, + enum noside noside, int nargs); +}; + } /* namespace expr */ #endif /* EXPOP_H */ |