From: Daniel Jacobowitz <dan@codesourcery.com>
To: Ken Werner <ken@linux.vnet.ibm.com>
Cc: Ulrich Weigand <uweigand@de.ibm.com>,
gdb-patches@sourceware.org,
Joel Brobecker <brobecker@adacore.com>
Subject: Re: [patch] fix pre-/post- in-/decrement
Date: Mon, 04 Oct 2010 20:45:00 -0000 [thread overview]
Message-ID: <20101004204538.GA1052@caradoc.them.org> (raw)
In-Reply-To: <201010042146.50252.ken@linux.vnet.ibm.com>
On Mon, Oct 04, 2010 at 09:46:50PM +0200, Ken Werner wrote:
> The attached patch introduces a new function called value_non_lval that
> returns a non-lval version of the given value. This function is called prior
> the simple assignment, compound assignment and pre/postfix routines return. Any
> comments are appreciated.
I think this will have an undesired effect.
Try this - it's easiest to see what's going on with set debug target
1, or else by using gdbserver and set debug remote 1 (the latter is
easier for me to read). I've edited out some reads relating to the
stack frame.
(gdb) set $p = (int *) $sp
(gdb) p *$p
Sending packet: $m7fffffffdff0,4#2e...Packet received: 01000000
$4 = 1
(gdb) set *$p = 2
Sending packet: $X7fffffffdff0,4:\002\000\000\000#55...Packet received: OK
(gdb) print *$p = 1
Sending packet: $X7fffffffdff0,4:\001\000\000\000#54...Packet received: OK
Sending packet: $m7fffffffdff0,4#2e...Packet received: 01000000
$5 = 1
(gdb)
I suspect that your patch will be called to handle the value_assign
for the set command, and it will result in an unnecessary read from
the target. You want the resulting value to be unwritable, but it can
still be lazy; you don't need the value.
Of course, those two things are not orthogonal in GDB's current
representation. So I don't know how to do this. But don't break the
current behavior, please - it's important both for performance and for
embedded correctness.
--
Daniel Jacobowitz
CodeSourcery
next prev parent reply other threads:[~2010-10-04 20:45 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 [this message]
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 ` [patch] fix pre-/post- in-/decrement Vladimir Prus
2010-10-07 12:38 ` 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=20101004204538.GA1052@caradoc.them.org \
--to=dan@codesourcery.com \
--cc=brobecker@adacore.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