Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: Jan Kratochvil <jan.kratochvil@redhat.com>
Subject: Re: [patch 11/12] entryval#2: @entry values even for references
Date: Fri, 16 Sep 2011 12:29:00 -0000	[thread overview]
Message-ID: <201109161326.09350.pedro@codesourcery.com> (raw)
In-Reply-To: <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


  reply	other threads:[~2011-09-16 12:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-13 19:52 Jan Kratochvil
2011-09-16 12:29 ` Pedro Alves [this message]
2011-09-16 19:15   ` Jan Kratochvil
2011-09-21 15:54     ` Pedro Alves
2011-09-22 22:49       ` Jan Kratochvil
2011-09-23  6:02         ` Pedro Alves
2011-09-23  8:37           ` Jan Kratochvil
2011-09-23 10:27             ` Pedro Alves
2011-09-23 12:02               ` Jan Kratochvil
2011-09-23 12:08                 ` Pedro Alves
2011-09-23 15:04                   ` Jan Kratochvil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201109161326.09350.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox