From: Marc Khouzam <marc.khouzam@ericsson.com>
To: "'Hui Zhu'" <teawater@gmail.com>,
"'Daniel Jacobowitz'" <drow@false.org>,
"'gdb@sourceware.org'" <gdb@sourceware.org>,
"'Michael Snyder'" <msnyder@vmware.com>,
"'gdb-patches ml'" <gdb-patches@sourceware.org>
Subject: RE: PRecord sets memory even when it says it did not
Date: Mon, 14 Sep 2009 17:10:00 -0000 [thread overview]
Message-ID: <F7CE05678329534C957159168FA70DEC515363D00C@EUSAACMS0703.eamcs.ericsson.se> (raw)
In-Reply-To: <daef60380909140914x64a2b25fi242f1457bdaccfd2@mail.gmail.com>
> -----Original Message-----
> From: Hui Zhu [mailto:teawater@gmail.com]
> Sent: Monday, September 14, 2009 12:15 PM
> To: Daniel Jacobowitz; Marc Khouzam; gdb@sourceware.org;
> Michael Snyder; gdb-patches ml
> Subject: Re: PRecord sets memory even when it says it did not
>
> 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.
I think Hui is right. I ran another test with printf and stopping precord
and the memory seems ok, please see session below.
> BTW, this is really a strange thing. If answer is enter, everything
> is OK. If answer is no, it was changed.
For me the problem happens both times, when pressing 'n' or <enter>.
(you can see that in the session below too)
(gdb) l
1 #include <stdio.h>
2 int main()
3 {
4 int a = 0;
5 printf("a is %d\n",a);
6 return 0;
7 }
(gdb) start
Temporary breakpoint 1 at 0x8048485: file a.cc, line 4.
Starting program: /local/lmckhou/testing/a.out
re
Temporary breakpoint 1, main () at a.cc:4
4 int a = 0;
(gdb) rec
(gdb) n
5 printf("a is %d\n",a);
(gdb) n
a is 0
6 return 0;
(gdb) rn
5 printf("a is %d\n",a);
(gdb) p a
$1 = 0
(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 0xbfffadf0?(y or [n])
Process record canceled the operation.
(gdb) p a
$2 = 8
(gdb) rec stop
Delete recorded log and stop recording?(y or n) y
(gdb) p a
$3 = 8
(gdb) n
a is 0 <------------------------------------------ a is actually set correctly
6 return 0;
(gdb) p a
$4 = 0
>
>
> >
> >> 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
>
next prev parent reply other threads:[~2009-09-14 17:10 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <F7CE05678329534C957159168FA70DEC5153600749@EUSAACMS0703.eamcs.ericsson.se>
2009-09-14 4:40 ` Hui Zhu
2009-09-14 13:52 ` Marc Khouzam
2009-09-14 17:17 ` Michael Snyder
2009-09-14 17:21 ` Marc Khouzam
2009-09-14 17:26 ` Michael Snyder
2009-09-14 15:53 ` Daniel Jacobowitz
2009-09-14 16:15 ` Hui Zhu
2009-09-14 17:10 ` Marc Khouzam [this message]
2009-09-14 17:10 ` Greg Law
2009-09-14 17:19 ` Marc Khouzam
2009-09-14 17:50 ` Pedro Alves
2009-09-14 17:54 ` Marc Khouzam
2009-09-14 18:00 ` Michael Snyder
2009-09-14 18:01 ` Pedro Alves
2009-09-14 18:02 ` Michael Snyder
2009-09-14 18:15 ` Pedro Alves
2009-09-14 18:21 ` Michael Snyder
2009-09-14 18:36 ` Pedro Alves
2009-09-14 19:04 ` Doug Evans
2009-09-14 19:08 ` Michael Snyder
2009-09-14 20:36 ` Pedro Alves
2009-09-14 21:08 ` Doug Evans
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=F7CE05678329534C957159168FA70DEC515363D00C@EUSAACMS0703.eamcs.ericsson.se \
--to=marc.khouzam@ericsson.com \
--cc=drow@false.org \
--cc=gdb-patches@sourceware.org \
--cc=gdb@sourceware.org \
--cc=msnyder@vmware.com \
--cc=teawater@gmail.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