mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-01 11:59:27 +08:00
Remove eval_op_string
eval_op_string is only used in a single place -- the implementation of string_operation. This patch turns it into the string_operation::evaluate method, removing a bit of extraneous code.
This commit is contained in:
17
gdb/eval.c
17
gdb/eval.c
@ -1078,17 +1078,22 @@ eval_op_register (struct type *expect_type, struct expression *exp,
|
||||
return val;
|
||||
}
|
||||
|
||||
/* Helper function that implements the body of OP_STRING. */
|
||||
|
||||
struct value *
|
||||
eval_op_string (struct type *expect_type, struct expression *exp,
|
||||
enum noside noside, int len, const char *string)
|
||||
namespace expr
|
||||
{
|
||||
|
||||
value *
|
||||
string_operation::evaluate (struct type *expect_type,
|
||||
struct expression *exp,
|
||||
enum noside noside)
|
||||
{
|
||||
const std::string &str = std::get<0> (m_storage);
|
||||
struct type *type = language_string_char_type (exp->language_defn,
|
||||
exp->gdbarch);
|
||||
return value_string (string, len, type);
|
||||
return value_string (str.c_str (), str.size (), type);
|
||||
}
|
||||
|
||||
} /* namespace expr */
|
||||
|
||||
/* Helper function that implements the body of OP_OBJC_SELECTOR. */
|
||||
|
||||
struct value *
|
||||
|
Reference in New Issue
Block a user