This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] fix pre-/post- in-/decrement
On Mon, Oct 04, 2010 at 11:57:47PM +0200, Ulrich Weigand wrote:
> It would appear that even the current behavior, as shown in your trace,
> already contains an unnecessary load. There should be no need to perform
> a memory read to evaluate "print *$p = 1".
In fact, we rely on this unintuitive behavior. If you write to any
kind of memory other than RAM, then it's not possible for GDB to
predict what value was actually written. Suppose you write a value to
ROM with "print"; GDB should show the old value, to reflect that the
variable was not modified.
I can't think of a good way to test this other than by matching debug
output...
--
Daniel Jacobowitz
CodeSourcery