Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Hui Zhu <teawater@gmail.com>
To: Marc Khouzam <marc.khouzam@ericsson.com>
Cc: "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 04:40:00 -0000	[thread overview]
Message-ID: <daef60380909132139k46f577aet63f4089a97138368@mail.gmail.com> (raw)
In-Reply-To: <F7CE05678329534C957159168FA70DEC5153600749@EUSAACMS0703.eamcs.ericsson.se>

[-- Attachment #1: Type: text/plain, Size: 2643 bytes --]

On Mon, Sep 14, 2009 at 09:54, Marc Khouzam <marc.khouzam@ericsson.com> wrote:
> Hi Hui,
>
> I'm seeing PRecord changing memory even though I answer
> the query as to not change it.  Please 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 <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "i686-pc-linux-gnu".
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>...
> Reading symbols from /home/marc/testing/a.out...done.
> (gdb) l
> 1       int main() {
> 2           int a = 1;
> 3           int b = 10;
> 4
> 5           a++;
> 6           b++;
> 7
> 8           return a;
> 9       }
> 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           int a = 1;
> (gdb) record
> (gdb) n
> 3           int b = 10;
> (gdb) n
> 5           a++;
> (gdb) n
> 6           b++;
> (gdb) rn
> 5           a++;
> (gdb) p a
> $1 = 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 0xbffff6a0?(y or [n]) n
> Process record canceled the operation.
> (gdb) p a
> $2 = 8
>



Hi Marc,

Thanks for your help.

I just tried change it with "p a=99".  I think it must have something
different with "set var a = 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  <teawater@gmail.com>

	* 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 ();

[-- Attachment #2: prec-fix-memory-cancel-bug.txt --]
[-- Type: text/plain, Size: 585 bytes --]

---
 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 ();

       reply	other threads:[~2009-09-14  4:40 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 [this message]
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
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=daef60380909132139k46f577aet63f4089a97138368@mail.gmail.com \
    --to=teawater@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=gdb@sourceware.org \
    --cc=marc.khouzam@ericsson.com \
    --cc=msnyder@vmware.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