aboutsummaryrefslogtreecommitdiff
path: root/gdb/rust-exp.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:27 -0700
commit5947d337d6061b884073a3a684aff2825c4a05f9 (patch)
tree672e421f087f5c858c7b9bfc0cabca22066f4c51 /gdb/rust-exp.h
parente4407a202d31a6873ea240b13125bf1ae8d20401 (diff)
downloadgdb-5947d337d6061b884073a3a684aff2825c4a05f9.zip
gdb-5947d337d6061b884073a3a684aff2825c4a05f9.tar.gz
gdb-5947d337d6061b884073a3a684aff2825c4a05f9.tar.bz2
Introduce rust_aggregate_operation
This adds class rust_aggregate_operation, which implements OP_AGGREGATE for Rust. gdb/ChangeLog 2021-03-08 Tom Tromey <tom@tromey.com> * rust-lang.c (rust_aggregate_operation::evaluate): New method. * rust-exp.h (class rust_aggregate_operation): New.
Diffstat (limited to 'gdb/rust-exp.h')
-rw-r--r--gdb/rust-exp.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/gdb/rust-exp.h b/gdb/rust-exp.h
index 19e945c..6e529f8 100644
--- a/gdb/rust-exp.h
+++ b/gdb/rust-exp.h
@@ -207,6 +207,24 @@ public:
{ return STRUCTOP_STRUCT; }
};
+/* Rust aggregate initialization. */
+class rust_aggregate_operation
+ : public tuple_holding_operation<struct type *, operation_up,
+ std::vector<std::pair<std::string,
+ 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_AGGREGATE; }
+};
+
} /* namespace expr */
#endif /* RUST_EXP_H */