+2021-03-08 Tom Tromey <tom@tromey.com>
+
+ * eval.c: Include c-exp.h.
+ * c-exp.h (class objc_nsstring_operation): New.
+
2021-03-08 Tom Tromey <tom@tromey.com>
* c-lang.c (c_string_operation::evaluate): New method.
#define C_EXP_H
#include "expop.h"
+#include "objc-lang.h"
namespace expr
{
{ return OP_STRING; }
};
+class objc_nsstring_operation
+ : public tuple_holding_operation<std::string>
+{
+public:
+
+ using tuple_holding_operation::tuple_holding_operation;
+
+ value *evaluate (struct type *expect_type,
+ struct expression *exp,
+ enum noside noside) override
+ {
+ if (noside == EVAL_SKIP)
+ return eval_skip_value (exp);
+ const std::string &str = std::get<0> (m_storage);
+ return value_nsstring (exp->gdbarch, str.c_str (), str.size () + 1);
+ }
+
+ enum exp_opcode opcode () const override
+ { return OP_OBJC_NSSTRING; }
+};
+
}/* namespace expr */
#endif /* C_EXP_H */