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 v3 03/11] [PR gdb/14441] gdb: valops: add ability to return rvalue reference values from value_ref()


On 03/04/2016 07:19 PM, Artemiy Volkov wrote:
> diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c
> index 62552ec..a1f5db6 100644
> --- a/gdb/c-valprint.c
> +++ b/gdb/c-valprint.c
> @@ -602,10 +602,13 @@ c_value_print (struct value *val, struct ui_file *stream,
>        else if (options->objectprint
>  	       && (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_STRUCT))
>  	{
> -	  int is_ref = TYPE_CODE (type) == TYPE_CODE_REF;
> +	  int is_ref = TYPE_IS_REFERENCE (type);
> +	  enum type_code refcode = TYPE_CODE_UNDEF;
>  
> -	  if (is_ref)
> +	  if (is_ref) {
>  	    val = value_addr (val);
> +	    refcode = TYPE_CODE (type);
> +	  }
>  

Open braces go on new line.

>  	  /* Pointer to class, check real type of object.  */
>  	  fprintf_filtered (stream, "(");

Keith


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