This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] eval.c:evaluate_subexp_standard: Factor out function call handling


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]