public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: qiyaoltc@gmail.com (Yao Qi)
Cc: user-agent@de.ibm.com;,
	      
	bh=bRSZrFs7MDCHH9pBZWPVTfOSNPe/nJuj407ynYvPgXM=@de.ibm.com;,
	      
	b=Ad2ef64JwNZkXMSBRIw9rjjbKD3TRg5+F7YP3OvdCo7XdZIOHnnX9P8Bq+YX6BV2SWCHunVt2nVkgOreg4Sj2rsH9OrG70EvWdRw3lMXWWl8e5E7+T17MKumAdjj+9kxYu1c5oc1/CeW7UG444M/MDt+GN+Db@gmail.com,
	       gdb-patches@sourceware.org (gdb-patches@sourceware.org),
	       tom@tromey.com (Tom Tromey)
Subject: Re: set_value_component_location in apply_val_pretty_printer
Date: Mon, 14 Nov 2016 16:38:00 -0000	[thread overview]
Message-ID: <20161114163832.3C14F10B924@oc8523832656.ibm.com> (raw)
In-Reply-To: <20161114125143.GA22037@E107787-LIN> from "Yao Qi" at Nov 14, 2016 12:51:43 PM

Yao Qi wrote:
> On Fri, Oct 28, 2016 at 08:58:33PM +0200, Ulrich Weigand wrote:
> > But this isn't really correct either, since we need the
> > location of the *subobject*.  Now if the value resides
> > in inferior memory, we can get there simply by adding
> > the offset to the value address.  But that's not actually
> > correct for values with other location types.
> 
> I don't see why it is not correct to set the value's location to the same as
> the location of old.  The 'whole' object and 'component' object should have
> the same location with different offsets (internalvar is an exception since 
> the component's location is interanlvar_component), so
> set_value_component_location  looks right to me.

I think in the past we have avoided using value_offset for lval_memory
values for some reason.  It's been used only for values in registers
(or other non-memory values).  I'm not really sure why this is the
case -- maybe value_offset isn't always taken into account everywhere?

But maybe it is indeed the best way to use value_offset for creating
subobjects, and if there's any fallout, just fix that.  (In the 
alternative, we might use value_offset for non-lval_memory values,
and just increment the address for lval_memory ones ...).

B.t.w. I noticed that the bottom half of value_subscripted_rvalue
now looks very similar to your new value_from_component routine;
maybe it ought to be used there too.

Otherwise the patch looks good to me.

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich.Weigand@de.ibm.com

  reply	other threads:[~2016-11-14 16:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-28 14:18 Yao Qi
2016-10-28 18:58 ` Ulrich Weigand
2016-10-31  3:07   ` Tom Tromey
2016-11-14 12:52   ` Yao Qi
2016-11-14 16:38     ` Ulrich Weigand [this message]
2016-11-21 14:14       ` Yao Qi
2016-11-21 18:23         ` Yao Qi
2016-11-21 20:37           ` Yao Qi
2016-11-22  9:00             ` Yao Qi

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=20161114163832.3C14F10B924@oc8523832656.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=qiyaoltc@gmail.com \
    --cc=user-agent@de.ibm.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).