Mirror of the gdb-patches mailing list
 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=w3l5Ym541pvuwML9/6SKkkW70PlV/JFWNgp0ub7fEec=@de.ibm.com;,
	      
	b=XnKcs0r3lZWx7Ceaf3Cswl5MRddHbb49TdlQOOMFuCfi2P9bEJYGh0qu/y0vrMWR87KF8NAAthSrdqry+pI4iDU6E3DFYkbF4i4s7zYh7DZwetUGtPlOgUUDR30ecLpPgE0PLwSeidueDbqooIodY+xzc2f8q@gmail.com,
	       palves@redhat.com (Pedro Alves),
	       brobecker@adacore.com (Joel Brobecker),
	gdb-patches@sourceware.org
Subject: Re: [PATCH 1/3] New function value_has_address
Date: Wed, 23 Nov 2016 12:50:00 -0000	[thread overview]
Message-ID: <20161123125000.DBC6D10FB47@oc8523832656.ibm.com> (raw)
In-Reply-To: <20161123092621.GD24810@E107787-LIN> from "Yao Qi" at Nov 23, 2016 09:26:21 AM

Yao Qi wrote:
> On Tue, Nov 22, 2016 at 07:16:15PM +0100, Ulrich Weigand wrote:
> > > I think that it's good that the names match.  If one is renamed,
> > > so should the other, IMO.  Maybe call the function
> > > value_has_address_location?  I think it'd be good if the
> > > function's intro comment made this link more explicit.
> > > Actually, I see now that patch #3 tweaks the comment.
> > 
> > I think part of the confusion is that the comment above is simply
> > no longer true; for lval_register values, address is *not* (any longer)
> > used to hold any byte offset into a register structure, as far as I
> > can see.  Instead, for lval_register values, the register that holds
> > the value is identifed solely via the VALUE_REGNUM/VALUE_NEXT_FRAME_ID
> > fields, and the address field is ignored.
> 
> That is what I am saying in the last paragraph of cover letter.

I see, I missed that.  I think given that we really only ever should
use value.location.address on lval_memory values, maybe the clearest way
would be to guard accesses with an explicit VALUE_LVAL == lval_memory
check instead of moving that check to a function.  Then we don't have
to debate how that function should be called either :-)

> > I think we should reword the comments to reflect the fact that
> > "address" is only used for lval_address.  On the other hand,
> > the regnum/frame_id fields should move into the union and only
> > be used for lval_register values ...
> > 
> 
> That is what I am trying to do in next step.  Let me finish it and
> include it in this series as well.

Very good, thanks!

[ B.t.w. I noticed one more case of fields that probably ought to
move into the location union: value.parent, .bitsize, and .bitpos
are only ever used for bitfields.   Maybe we should create a new
lval_component (possibly renamed from lval_internalval_component)
that uses those three fields as location; where all further data
is retrieved from the parent value.  But that's certainly another
independent change ... ]

Bye,
Ulrich

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


  reply	other threads:[~2016-11-23 12:50 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-22 15:49 [PATCH 0/3] " Yao Qi
2016-11-22 15:49 ` [PATCH 2/3] Set VALUE_VAL before set_value_address Yao Qi
2016-11-22 17:46   ` Luis Machado
2016-11-22 18:03   ` Pedro Alves
2016-11-22 15:49 ` [PATCH 3/3] Restrict value_has_address Yao Qi
2016-11-22 18:06   ` Pedro Alves
2016-11-22 15:49 ` [PATCH 1/3] New function value_has_address Yao Qi
2016-11-22 16:50   ` Joel Brobecker
2016-11-22 17:56     ` Pedro Alves
2016-11-22 18:16       ` Ulrich Weigand
2016-11-22 18:29         ` Pedro Alves
2016-11-23  9:26         ` Yao Qi
2016-11-23 12:50           ` Ulrich Weigand [this message]
2016-11-25 10:07             ` [PATCH 0/3] regnum and next_frame_id are only used for lval_register Yao Qi
2016-11-25 10:07               ` [PATCH 2/3] Adjust Value.location " Yao Qi
2016-11-25 11:51                 ` Ulrich Weigand
2016-11-25 11:57                   ` Yao Qi
2016-11-25 12:10                     ` Ulrich Weigand
2016-11-28 17:22                       ` Yao Qi
2016-11-25 10:07               ` [PATCH 1/3] Move computed value's frame id to piece_closure Yao Qi
2016-11-25 11:48                 ` Ulrich Weigand
2016-11-28 17:20                   ` Yao Qi
2016-11-25 10:07               ` [PATCH 3/3] Restrict checking value.lval on using address Yao Qi
2016-11-25 11:52                 ` Ulrich Weigand
2016-11-28 17:22                   ` 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=20161123125000.DBC6D10FB47@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