From: Vladimir Prus <vladimir@codesourcery.com>
To: Daniel Jacobowitz <dan@codesourcery.com>
Cc: Ulrich Weigand <uweigand@de.ibm.com>,
Ken Werner <ken@linux.vnet.ibm.com>,
gdb-patches@sourceware.org,
Joel Brobecker <brobecker@adacore.com>
Subject: Re: [patch] fix pre-/post- in-/decrement
Date: Wed, 06 Oct 2010 20:55:00 -0000 [thread overview]
Message-ID: <201010070055.29428.vladimir@codesourcery.com> (raw)
In-Reply-To: <20101005134200.GJ6985@caradoc.them.org>
On Tuesday, October 05, 2010 17:42:01 you wrote:
> On Tue, Oct 05, 2010 at 03:28:19PM +0200, Ulrich Weigand wrote:
> > Daniel Jacobowitz wrote:
> > > On Tue, Oct 05, 2010 at 01:24:51AM +0200, Ulrich Weigand wrote:
> > > > - If you execute "set *$p = *$q = 0" and the write to *$q fails,
> > > >
> > > > do you really expect *$p to be set to the old value of *$q
> > > > instead of to 0?
> > >
> > > Yes, I would expect that. To me, this is roughly "the debugger treats
> > > all pointers as volatile".
> >
> > The thing is, I had interpreted the C standard to read that even if
> > pointers p and q *are* volatile, a statement like "*p = *q = 0" would
> > still just trigger two writes, and no reads.
>
> You're right, I remember Nathan's recent arguments about this on
> gcc-patches.
>
> > "Assignments are also expressions and have an rvalue. However when
> > assigning to a scalar volatile, the volatile object is not reread,
> > regardless of whether the assignment expression's rvalue is used or not.
> > If the assignment's rvalue is used, the value is that assigned to the
> > volatile object. [...] If you need to read the volatile object after an
> > assignment has occurred, you must use a separate expression with an
> > intervening sequence point."
> >
> > To reduce the potential for confusion, it seems to me GDB ought to mirror
> > that behavior as well ...
>
> Hmm.
>
> It seems to me that this is a disruptive change for us, because the "a
> = b" case is more likely to be used than anything fancy (a += b, a = b
> = c). If we change it, we should document the change.
>
> Vladimir, would this interact with your recent varobj changes? We
> worked out exactly which reads we wanted, but I don't remember if
> value_assign is involved.
I don't think value_assign was involved in my changes -- instead, I have
modified varobj_set_value to do a read-back of the value being assigned
to.
I am not entirely sure whether on CLI, one wants:
print $io.whatever = 10
to print '10' or the value in $io.whatever. Maybe, following C rules has
some sense here. On the other hand, in GUI there's no assignment
expression, so C standard is probably not a useful analogue.
So, I guess this patch is compatible with our changes.
- Volodya
next prev parent reply other threads:[~2010-10-06 20:55 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-17 12:58 [patch] GNU vector unop support Ken Werner
2010-09-28 16:04 ` Ken Werner
[not found] ` <20100930185634.GC6213@adacore.com>
2010-10-01 17:45 ` [patch] fix pre-/post- in-/decrement Ken Werner
2010-10-04 13:01 ` Ulrich Weigand
2010-10-04 19:47 ` Ken Werner
2010-10-04 20:45 ` Daniel Jacobowitz
2010-10-04 21:58 ` Ulrich Weigand
2010-10-04 22:59 ` Daniel Jacobowitz
2010-10-04 23:25 ` Ulrich Weigand
2010-10-05 1:17 ` Daniel Jacobowitz
2010-10-05 13:28 ` Ulrich Weigand
2010-10-05 13:42 ` Daniel Jacobowitz
2010-10-06 18:59 ` [rfc] Fix value_assign return value (Re: [patch] fix pre-/post- in-/decrement) Ulrich Weigand
2010-10-26 13:42 ` Daniel Jacobowitz
2010-12-01 16:51 ` Ulrich Weigand
2010-10-06 20:55 ` Vladimir Prus [this message]
2010-10-07 12:38 ` [patch] fix pre-/post- in-/decrement Ken Werner
2010-10-12 23:00 ` Tom Tromey
2010-10-13 8:45 ` Andreas Schwab
2010-10-13 9:23 ` Ken Werner
2010-10-13 16:07 ` Daniel Jacobowitz
2010-10-13 19:01 ` Tom Tromey
2010-10-19 7:38 ` Ken Werner
2010-11-02 8:23 ` Ken Werner
2010-11-02 20:31 ` Tom Tromey
2010-11-03 13:52 ` Ken Werner
2010-10-04 20:52 ` [patch] GNU vector unop support Ken Werner
2010-10-06 23:27 ` Joel Brobecker
2010-10-07 16:23 ` Ken Werner
2010-11-03 14:07 ` Ken Werner
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=201010070055.29428.vladimir@codesourcery.com \
--to=vladimir@codesourcery.com \
--cc=brobecker@adacore.com \
--cc=dan@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=ken@linux.vnet.ibm.com \
--cc=uweigand@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