aboutsummaryrefslogtreecommitdiff
path: root/gdb/expop.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2021-03-08 07:27:57 -0700
committerTom Tromey <tom@tromey.com>2021-03-08 07:28:25 -0700
commit821e72d77536b201b3e6b801d8f0d9c5b624ec96 (patch)
treec0cfed195b7efe6137ed0e6d25e443f9657a4112 /gdb/expop.h
parent085734dd954dd2b3da9445dc517bfdb10f9ca117 (diff)
downloadgdb-821e72d77536b201b3e6b801d8f0d9c5b624ec96.zip
gdb-821e72d77536b201b3e6b801d8f0d9c5b624ec96.tar.gz
gdb-821e72d77536b201b3e6b801d8f0d9c5b624ec96.tar.bz2
Introduce multi_subscript_operation
This adds class multi_subscript_operation, which implements MULTI_SUBSCRIPT. gdb/ChangeLog 2021-03-08 Tom Tromey <tom@tromey.com> * expop.h (class multi_subscript_operation): New. * eval.c (multi_subscript_operation::evaluate): New method.
Diffstat (limited to 'gdb/expop.h')
-rw-r--r--gdb/expop.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/gdb/expop.h b/gdb/expop.h
index ef5b9bb..6b1a875 100644
--- a/gdb/expop.h
+++ b/gdb/expop.h
@@ -1966,6 +1966,22 @@ using dynamic_cast_operation = cxx_cast_operation<UNOP_DYNAMIC_CAST,
using reinterpret_cast_operation = cxx_cast_operation<UNOP_REINTERPRET_CAST,
value_reinterpret_cast>;
+/* Multi-dimensional subscripting. */
+class multi_subscript_operation
+ : public tuple_holding_operation<operation_up, 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 MULTI_SUBSCRIPT; }
+};
+
} /* namespace expr */
#endif /* EXPOP_H */