This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] eval.c:evaluate_subexp_standard: Factor out function call handling
- From: Pedro Alves <palves at redhat dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 5 Sep 2017 11:19:22 +0100
- Subject: Re: [PATCH] eval.c:evaluate_subexp_standard: Factor out function call handling
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=palves at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 254B13680F
- References: <1504563210-2521-1-git-send-email-palves@redhat.com> <20170905094312.GC8425@1170ee0b50d5>
On 09/05/2017 10:43 AM, Yao Qi wrote:
> On 17-09-04 23:13:30, Pedro Alves wrote:
>> While working on the no-debug-info debugging improvements, I found
>> evaluate_subexp_standard's function call code unnecessarily long and
>> hard to navigate and debug. The use of goto doesn't help either.
>
> It is good to shorten the long function. Patch looks good to me.
>
>> +/* Evaluate a function call. The function to be called is in
>> + argvec[0]. FUNCTION_NAME is the name of the function, if known.
>
> s/argvec/ARGVEC/ ?
> and better to document that argvec[1] - argvec[nargs] are arguments
> passed to the function.
>
Indeed. I'll push it in with this comment:
/* 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]. 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. */
Thanks,
Pedro Alves