This is the mail archive of the frysk-cvs@sources.redhat.com mailing list for the frysk project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[SCM] master: Maintain previous value of watched variable statically.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]