From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21784 invoked by alias); 14 Sep 2009 04:40:04 -0000 Received: (qmail 21722 invoked by uid 22791); 14 Sep 2009 04:40:02 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_12,SARE_MSGID_LONG40,SPF_PASS,WEIRD_PORT X-Spam-Check-By: sourceware.org Received: from mail-px0-f180.google.com (HELO mail-px0-f180.google.com) (209.85.216.180) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 14 Sep 2009 04:39:56 +0000 Received: by pxi10 with SMTP id 10so2437562pxi.24 for ; Sun, 13 Sep 2009 21:39:55 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.151.5 with SMTP id y5mr425950wfd.329.1252903195078; Sun, 13 Sep 2009 21:39:55 -0700 (PDT) In-Reply-To: References: From: Hui Zhu Date: Mon, 14 Sep 2009 04:40:00 -0000 Message-ID: Subject: Re: PRecord sets memory even when it says it did not To: Marc Khouzam Cc: "gdb@sourceware.org" , Michael Snyder , gdb-patches ml Content-Type: multipart/mixed; boundary=000e0cd312d6e171af0473824105 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-09/txt/msg00391.txt.bz2 --000e0cd312d6e171af0473824105 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-length: 2695 On Mon, Sep 14, 2009 at 09:54, Marc Khouzam wro= te: > Hi Hui, > > I'm seeing PRecord changing memory even though I answer > the query as to not change it. =A0Please see below. > > Thanks > > Marc > > GNU gdb (GDB) 6.8.50.20090913-cvs > Copyright (C) 2009 Free Software Foundation, Inc. > License GPLv3+: GNU GPL version 3 or later > This is free software: you are free to change and redistribute it. > There is NO WARRANTY, to the extent permitted by law. =A0Type "show copyi= ng" > and "show warranty" for details. > This GDB was configured as "i686-pc-linux-gnu". > For bug reporting instructions, please see: > ... > Reading symbols from /home/marc/testing/a.out...done. > (gdb) l > 1 =A0 =A0 =A0 int main() { > 2 =A0 =A0 =A0 =A0 =A0 int a =3D 1; > 3 =A0 =A0 =A0 =A0 =A0 int b =3D 10; > 4 > 5 =A0 =A0 =A0 =A0 =A0 a++; > 6 =A0 =A0 =A0 =A0 =A0 b++; > 7 > 8 =A0 =A0 =A0 =A0 =A0 return a; > 9 =A0 =A0 =A0 } > 10 > (gdb) start > Temporary breakpoint 1 at 0x80483f5: file b.cc, line 2. > Starting program: /home/marc/testing/a.out > re > Temporary breakpoint 1, main () at b.cc:2 > 2 =A0 =A0 =A0 =A0 =A0 int a =3D 1; > (gdb) record > (gdb) n > 3 =A0 =A0 =A0 =A0 =A0 int b =3D 10; > (gdb) n > 5 =A0 =A0 =A0 =A0 =A0 a++; > (gdb) n > 6 =A0 =A0 =A0 =A0 =A0 b++; > (gdb) rn > 5 =A0 =A0 =A0 =A0 =A0 a++; > (gdb) p a > $1 =3D 1 > (gdb) set var a =3D 8 > Because GDB is in replay mode, writing to memory will make the execution = log unusable from this point onward. =A0Write memory at address 0xbffff6a0?= (y or [n]) n > Process record canceled the operation. > (gdb) p a > $2 =3D 8 > Hi Marc, Thanks for your help. I just tried change it with "p a=3D99". I think it must have something different with "set var a =3D 8". This issue is because some value cache about the memory. So I add a "free_all_values ();" before error. It looks OK now. Please help me try it. Thanks, Hui 2009-09-14 Hui Zhu * record.c (record_xfer_partial): Call free_all_values when cancel the operation. --- record.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/record.c +++ b/record.c @@ -1023,7 +1023,10 @@ record_xfer_partial (struct target_ops * "will make the execution log unusable from this " "point onward. Write memory at address %s?"), paddress (target_gdbarch, offset))) - error (_("Process record canceled the operation.")); + { + free_all_values (); + error (_("Process record canceled the operation.")); + } /* Destroy the record from here forward. */ record_list_release_next (); --000e0cd312d6e171af0473824105 Content-Type: text/plain; charset=US-ASCII; name="prec-fix-memory-cancel-bug.txt" Content-Disposition: attachment; filename="prec-fix-memory-cancel-bug.txt" Content-Transfer-Encoding: base64 X-Attachment-Id: f_fzkqdend0 Content-length: 793 LS0tCiByZWNvcmQuYyB8ICAgIDUgKysrKy0KIDEgZmlsZSBjaGFuZ2VkLCA0 IGluc2VydGlvbnMoKyksIDEgZGVsZXRpb24oLSkKCi0tLSBhL3JlY29yZC5j CisrKyBiL3JlY29yZC5jCkBAIC0xMDIzLDcgKzEwMjMsMTAgQEAgcmVjb3Jk X3hmZXJfcGFydGlhbCAoc3RydWN0IHRhcmdldF9vcHMgKgogCQkgICAgICAg ICAid2lsbCBtYWtlIHRoZSBleGVjdXRpb24gbG9nIHVudXNhYmxlIGZyb20g dGhpcyAiCiAJCSAgICAgICAgICJwb2ludCBvbndhcmQuICBXcml0ZSBtZW1v cnkgYXQgYWRkcmVzcyAlcz8iKSwKIAkJICAgICAgIHBhZGRyZXNzICh0YXJn ZXRfZ2RiYXJjaCwgb2Zmc2V0KSkpCi0JICAgIGVycm9yIChfKCJQcm9jZXNz IHJlY29yZCBjYW5jZWxlZCB0aGUgb3BlcmF0aW9uLiIpKTsKKwkgICAgewor CSAgICAgIGZyZWVfYWxsX3ZhbHVlcyAoKTsKKwkgICAgICBlcnJvciAoXygi UHJvY2VzcyByZWNvcmQgY2FuY2VsZWQgdGhlIG9wZXJhdGlvbi4iKSk7CisJ ICAgIH0KIAogCSAgLyogRGVzdHJveSB0aGUgcmVjb3JkIGZyb20gaGVyZSBm b3J3YXJkLiAgKi8KIAkgIHJlY29yZF9saXN0X3JlbGVhc2VfbmV4dCAoKTsK --000e0cd312d6e171af0473824105--