public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
* [SCM]  master: Maintain previous value of watched variable statically.
@ 2008-05-28 18:57 tthomas
  0 siblings, 0 replies; only message in thread
From: tthomas @ 2008-05-28 18:57 UTC (permalink / raw)
  To: frysk-cvs

The branch, master has been updated
       via  3a848ec1396198a762420c60d340cf0cf77b2b11 (commit)
      from  96c93548e77eb436d7128ed95277832242e9f092 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 3a848ec1396198a762420c60d340cf0cf77b2b11
Author: Teresa Thomas <tthomas@redhat.com>
Date:   Wed May 28 14:59:16 2008 -0400

    Maintain previous value of watched variable statically.
    
    frysk-core/frysk/rt/ChangeLog:
    2008-05-28  Teresa Thomas  <tthomas@redhat.com>
    
    	* WatchObserverInstaller.java (oldValue): Make static.

-----------------------------------------------------------------------

Summary of changes:
 frysk-core/frysk/rt/ChangeLog                   |    4 +++-
 frysk-core/frysk/rt/WatchObserverInstaller.java |   13 ++++++++-----
 2 files changed, 11 insertions(+), 6 deletions(-)

First 500 lines of diff:
diff --git a/frysk-core/frysk/rt/ChangeLog b/frysk-core/frysk/rt/ChangeLog
index 0f9b8a9..abf6639 100644
--- a/frysk-core/frysk/rt/ChangeLog
+++ b/frysk-core/frysk/rt/ChangeLog
@@ -1,7 +1,9 @@
 2008-05-28  Teresa Thomas  <tthomas@redhat.com>
 
+	* WatchObserverInstaller.java (oldValue): Make static. 
+	
 	* WatchObserverInstaller.java: New file.
-
+	 
 2008-05-15  Sami Wagiaalla  <swagiaal@redhat.com>
 
 	* FunctionBreakpoint.java: Added comment.
diff --git a/frysk-core/frysk/rt/WatchObserverInstaller.java b/frysk-core/frysk/rt/WatchObserverInstaller.java
index d90bcda..885f43c 100644
--- a/frysk-core/frysk/rt/WatchObserverInstaller.java
+++ b/frysk-core/frysk/rt/WatchObserverInstaller.java
@@ -61,6 +61,11 @@ public class WatchObserverInstaller {
     
     private static int watchpointsInUse = 0;
     
+    // Maintain oldValue statically so that changes made to a 
+    // a value being watched by multiple watchpoints are
+    // are reflected in all watch observers.
+    private static String oldValue = "";
+    
     Expression expr;
     String exprString;
     SteppingEngine ste;
@@ -74,7 +79,7 @@ public class WatchObserverInstaller {
      * @param exprString Text string of expression
      */
     public WatchObserverInstaller(Expression expr, SteppingEngine ste,
-	    		       PrintWriter writer, String exprString) {
+	    		          PrintWriter writer, String exprString) {
 	this.expr = expr;
 	this.ste = ste;
 	this.writer = writer;
@@ -132,7 +137,6 @@ public class WatchObserverInstaller {
 	String exprString;
 	SteppingEngine ste;
 	PrintWriter writer;
-	String oldValue;
 	Task task;
 	
 	WatchpointObserver(Expression expr, String exprStr, Task task,
@@ -142,9 +146,8 @@ public class WatchObserverInstaller {
 	    this.ste = ste;
 	    this.writer = writer;
 	    this.task = task;
-	    this.oldValue = "";
-
 	}
+	
 	public Action updateHit(Task task, long address, int length) {
 
 	    String newValue = expr.getValue().toPrint
@@ -170,7 +173,7 @@ public class WatchObserverInstaller {
 	    watchpointsInUse++;
 	    // XXX: getValue may modify inferior.
 	    oldValue = expr.getValue().toPrint
-	                      (Format.NATURAL, task.getMemory());	    
+	               (Format.NATURAL, task.getMemory());	    
 	}
 
 	public void deletedFrom(Object observable) {


hooks/post-receive
--
frysk system monitor/debugger


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-05-28 18:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-28 18:57 [SCM] master: Maintain previous value of watched variable statically tthomas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).