This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v3 03/11] [PR gdb/14441] gdb: valops: add ability to return rvalue reference values from value_ref()
- From: Keith Seitz <keiths at redhat dot com>
- To: Artemiy Volkov <artemiyv at acm dot org>, gdb-patches at sourceware dot org
- Date: Wed, 16 Mar 2016 15:22:17 -0700
- Subject: Re: [PATCH v3 03/11] [PR gdb/14441] gdb: valops: add ability to return rvalue reference values from value_ref()
- Authentication-results: sourceware.org; auth=none
- References: <1453229609-20159-1-git-send-email-artemiyv at acm dot org> <1457147955-21871-1-git-send-email-artemiyv at acm dot org> <1457147955-21871-4-git-send-email-artemiyv at acm dot org>
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