diff options
author | Tom Tromey <tom@tromey.com> | 2020-12-15 17:53:34 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2020-12-15 17:53:34 -0700 |
commit | 1ab8280d7dbe01f51929d221621d38450f31895d (patch) | |
tree | 6ae791784db83a48b4cf9877e4f2a1ee481d3c92 /gdb/expression.h | |
parent | cf608cc40c523537046efde52e9d68303e8bde00 (diff) | |
download | binutils-1ab8280d7dbe01f51929d221621d38450f31895d.zip binutils-1ab8280d7dbe01f51929d221621d38450f31895d.tar.gz binutils-1ab8280d7dbe01f51929d221621d38450f31895d.tar.bz2 |
Clean up arguments to evaluate_subexp_do_call
I noticed hat evaluate_subexp_do_call takes an array of arguments and
a count -- but, unlike the usual convention, the count does not
include the first element.
This patch changes this function to match call_function_by_hand --
passing the callee separately, and using an array_view for the
arguments. This makes it simpler to understand.
Regression tested on x86-64 Fedora 28.
gdb/ChangeLog
2020-12-15 Tom Tromey <tom@tromey.com>
* f-lang.c (evaluate_subexp_f): Update.
* expression.h (evaluate_subexp_do_call): Update.
* eval.c (evaluate_subexp_do_call): Add callee parameter. Replace
nargs, argvec with array_view.
(evaluate_funcall): Update.
Diffstat (limited to 'gdb/expression.h')
-rw-r--r-- | gdb/expression.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gdb/expression.h b/gdb/expression.h index 9ac940f..0c4dc7b 100644 --- a/gdb/expression.h +++ b/gdb/expression.h @@ -153,15 +153,16 @@ enum noside 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); |