return value_string (str.c_str (), str.size (), type);
}
+struct value *
+ternop_slice_operation::evaluate (struct type *expect_type,
+ struct expression *exp,
+ enum noside noside)
+{
+ struct value *array
+ = std::get<0> (m_storage)->evaluate (nullptr, exp, noside);
+ struct value *low
+ = std::get<1> (m_storage)->evaluate (nullptr, exp, noside);
+ struct value *upper
+ = std::get<2> (m_storage)->evaluate (nullptr, exp, noside);
+
+ int lowbound = value_as_long (low);
+ int upperbound = value_as_long (upper);
+ return value_slice (array, lowbound, upperbound - lowbound + 1);
+}
+
} /* namespace expr */
/* Helper function that implements the body of OP_OBJC_SELECTOR. */
lookup_child_selector (exp->gdbarch, sel));
}
-/* A helper function for TERNOP_SLICE. */
-
-struct value *
-eval_op_ternop (struct type *expect_type, struct expression *exp,
- enum noside noside,
- struct value *array, struct value *low, struct value *upper)
-{
- int lowbound = value_as_long (low);
- int upperbound = value_as_long (upper);
- return value_slice (array, lowbound, upperbound - lowbound + 1);
-}
-
/* A helper function for STRUCTOP_STRUCT. */
struct value *
extern struct value *eval_op_register (struct type *expect_type,
struct expression *exp,
enum noside noside, const char *name);
-extern struct value *eval_op_ternop (struct type *expect_type,
- struct expression *exp,
- enum noside noside,
- struct value *array, struct value *low,
- struct value *upper);
extern struct value *eval_op_structop_struct (struct type *expect_type,
struct expression *exp,
enum noside noside,
value *evaluate (struct type *expect_type,
struct expression *exp,
- enum noside noside) override
- {
- struct value *array
- = std::get<0> (m_storage)->evaluate (nullptr, exp, noside);
- struct value *low
- = std::get<1> (m_storage)->evaluate (nullptr, exp, noside);
- struct value *upper
- = std::get<2> (m_storage)->evaluate (nullptr, exp, noside);
- return eval_op_ternop (expect_type, exp, noside, array, low, upper);
- }
+ enum noside noside) override;
enum exp_opcode opcode () const override
{ return TERNOP_SLICE; }