value *
evaluate_subexp_do_call (expression *exp, enum noside noside,
- int nargs, value **argvec,
+ value *callee,
+ gdb::array_view<value *> argvec,
const char *function_name,
type *default_return_type)
{
- if (argvec[0] == NULL)
+ if (callee == NULL)
error (_("Cannot evaluate function -- may be inlined"));
if (noside == EVAL_AVOID_SIDE_EFFECTS)
{
call an error. This can happen if somebody tries to turn
a variable into a function call. */
- type *ftype = value_type (argvec[0]);
+ type *ftype = value_type (callee);
if (ftype->code () == TYPE_CODE_INTERNAL_FUNCTION)
{
}
else if (ftype->code () == TYPE_CODE_XMETHOD)
{
- type *return_type
- = result_type_of_xmethod (argvec[0],
- gdb::make_array_view (argvec + 1,
- nargs));
+ type *return_type = result_type_of_xmethod (callee, argvec);
if (return_type == NULL)
error (_("Xmethod is missing return type."));
{
if (ftype->is_gnu_ifunc ())
{
- CORE_ADDR address = value_address (argvec[0]);
+ CORE_ADDR address = value_address (callee);
type *resolved_type = find_gnu_ifunc_target_type (address);
if (resolved_type != NULL)
error (_("Expression of type other than "
"\"Function returning ...\" used as function"));
}
- switch (value_type (argvec[0])->code ())
+ switch (value_type (callee)->code ())
{
case TYPE_CODE_INTERNAL_FUNCTION:
return call_internal_function (exp->gdbarch, exp->language_defn,
- argvec[0], nargs, argvec + 1);
+ callee, argvec.size (), argvec.data ());
case TYPE_CODE_XMETHOD:
- return call_xmethod (argvec[0], gdb::make_array_view (argvec + 1, nargs));
+ return call_xmethod (callee, argvec);
default:
- return call_function_by_hand (argvec[0], default_return_type,
- gdb::make_array_view (argvec + 1, nargs));
+ return call_function_by_hand (callee, default_return_type, argvec);
}
}
/* Nothing to be done; argvec already correctly set up. */
}
- return evaluate_subexp_do_call (exp, noside, nargs, argvec,
+ return evaluate_subexp_do_call (exp, noside, argvec[0],
+ gdb::make_array_view (argvec + 1, nargs),
var_func_name, expect_type);
}
extern struct value *evaluate_subexp_standard
(struct type *, struct expression *, int *, enum noside);
-/* Evaluate a function call. The function to be called is in ARGVEC[0] and
- the arguments passed to the function are in ARGVEC[1..NARGS].
+/* Evaluate a function call. The function to be called is in CALLEE and
+ the arguments passed to the function are in ARGVEC.
FUNCTION_NAME is the name of the function, if known.
DEFAULT_RETURN_TYPE is used as the function's return type if the return
type is unknown. */
extern struct value *evaluate_subexp_do_call (expression *exp,
enum noside noside,
- int nargs, value **argvec,
+ value *callee,
+ gdb::array_view<value *> argvec,
const char *function_name,
type *default_return_type);