This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch 11/12] entryval#2: @entry values even for references
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Cc: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Date: Fri, 16 Sep 2011 13:26:09 +0100
- Subject: Re: [patch 11/12] entryval#2: @entry values even for references
- References: <20110913195046.GL12849@host1.jankratochvil.net>
On Tuesday 13 September 2011 20:50:47, Jan Kratochvil wrote:
> + struct value *deref_val;
> +
> + deref_val = coerce_ref_if_computed (original_value);
Hmm, this doesn't look right. It ignores embedded_offset. What if the reference
we're currently printing is a field of a struct at offset != 0?
E.g., `struct { long l; long &r } foo;', and we're `p foo', which descends
into printing R at FOO + offset of R ?
> + if (deref_val)
> + {
> + common_val_print (deref_val, stream, recurse, options,
> + current_language);
> + return 0;
> + }
> +
> + deref_val = value_at (TYPE_TARGET_TYPE (type),
> + unpack_pointer (type,
> + valaddr + embedded_offset));
--
Pedro Alves