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 11/12] entryval#2: @entry values even for references


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


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