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 3/3] Restrict value_has_address


On 11/22/2016 03:48 PM, Yao Qi wrote:
> gdb:
> 
> 2016-11-21  Yao Qi  <yao.qi@linaro.org>
> 
> 	* value.c (value_has_address): Return true if lval is
> 	either lval_memory or lval_register.
> ---
>  gdb/value.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/gdb/value.c b/gdb/value.c
> index a093a9a..5ac9123 100644
> --- a/gdb/value.c
> +++ b/gdb/value.c
> @@ -1540,14 +1540,14 @@ value_lval_const (const struct value *value)
>    return value->lval;
>  }
>  
> -/* Return true if VALUE has address, otherwise return false.  */
> +/* Return true if VALUE->location.address is valid, otherwise return
> +   false.  */

I think it'd be clearer to say:

/* Return true if the VALUE's lval uses the value.location.address
   union member as location.  False otherwise.  */

>  
>  static int

BTW, this could be bool (in patch #1).

Thanks,
Pedro Alves


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