This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: PRecord sets memory even when it says it did not
- From: Hui Zhu <teawater at gmail dot com>
- To: Daniel Jacobowitz <drow at false dot org>, Marc Khouzam <marc dot khouzam at ericsson dot com>, "gdb at sourceware dot org" <gdb at sourceware dot org>, Michael Snyder <msnyder at vmware dot com>, gdb-patches ml <gdb-patches at sourceware dot org>
- Date: Tue, 15 Sep 2009 00:14:49 +0800
- Subject: Re: PRecord sets memory even when it says it did not
- References: <F7CE05678329534C957159168FA70DEC5153600749@EUSAACMS0703.eamcs.ericsson.se> <daef60380909132139k46f577aet63f4089a97138368@mail.gmail.com> <20090914155327.GA26740@caradoc.them.org>
On Mon, Sep 14, 2009 at 23:53, Daniel Jacobowitz <drow@false.org> wrote:
> On Mon, Sep 14, 2009 at 12:39:35PM +0800, Hui Zhu wrote:
>> > (gdb) set var a = 8
>> > Because GDB is in replay mode, writing to memory will make the execution log unusable from this point onward. ?Write memory at address 0xbffff6a0?(y or [n]) n
>> > Process record canceled the operation.
>> > (gdb) p a
>> > $2 = 8
>
> This should refetch the value from the target. ?What value is cached?
This value didn't really changed. It just be changed in cache, but
not memory. If you s or rs and check "a" again, you will found that
"a"'s value is right.
(gdb) set var a = 8
Because GDB is in replay mode, writing to memory will make the
execution log unusable from this point onward. Write memory at
address 0xbffff500?(y or [n])
Process record canceled the operation.
(gdb) p a
$2 = 1
(gdb) set var a = 8
Because GDB is in replay mode, writing to memory will make the
execution log unusable from this point onward. Write memory at
address 0xbffff500?(y or [n]) n
Process record canceled the operation.
(gdb) p a
$3 = 8
(gdb) rn
3 int b = 10;
(gdb) p a
$4 = 1
(gdb) n
5 a++;
(gdb) p a
$5 = 1
(gdb) n
No more reverse-execution history.
main () at 1.c:6
6 b++;
(gdb) p a
$6 = 2
(gdb)
BTW, this is really a strange thing. If answer is enter, everything
is OK. If answer is no, it was changed.
>
>> 2009-09-14 ?Hui Zhu ?<teawater@gmail.com>
>>
>> ? ? ? * record.c (record_xfer_partial): Call free_all_values when
>> ? ? ? cancel the operation.
>
> I don't think this is a good idea; this is a memory management
> function. ?It's not supposed to change the apparent values.
>
Agree. Looks we have a strange thing need to be handled.
Thanks,
Hui