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: Process watchpoint events as a whole rather than iterating over the whole physical range.


The branch, master has been updated
       via  9cdb46341ee8c766593debd5b3a43f2715b41bc6 (commit)
      from  8168d6edcf7a58fc490b9a4d37647b3576345334 (commit)

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

- Log -----------------------------------------------------------------
commit 9cdb46341ee8c766593debd5b3a43f2715b41bc6
Author: Phil Muldoon <pmuldoon@redhat.com>
Date:   Tue Jun 17 08:34:59 2008 +0100

    Process watchpoint events as a whole rather than iterating over the whole physical range.
    
    Lay the foundation for better information from the watchpoint hardware abstraction to the higher levels. (Ie why watchpoints triggered).
    
    2008-06-16  Phil Muldoon  <pmuldoon@redhat.com>
    
    	* WatchpointFunctions.java (getTriggeredWatchpoints): New.
    
    2008-06-16  Phil Muldoon  <pmuldoon@redhat.com>
    
    	* LinuxPtraceTaskState.java (Running.checkWatchpoint): Rewrite to use
    	WatchpointFunctions.getTriggeredWatchpoints().

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

Summary of changes:
 frysk-core/frysk/isa/watchpoints/ChangeLog         |    4 ++
 .../frysk/isa/watchpoints/WatchpointFunctions.java |   19 ++++++++++-
 frysk-core/frysk/proc/live/ChangeLog               |    5 +++
 .../frysk/proc/live/LinuxPtraceTaskState.java      |   34 ++++++++++---------
 4 files changed, 44 insertions(+), 18 deletions(-)

First 500 lines of diff:
diff --git a/frysk-core/frysk/isa/watchpoints/ChangeLog b/frysk-core/frysk/isa/watchpoints/ChangeLog
index 0dd75aa..74e9127 100644
--- a/frysk-core/frysk/isa/watchpoints/ChangeLog
+++ b/frysk-core/frysk/isa/watchpoints/ChangeLog
@@ -1,3 +1,7 @@
+2008-06-16  Phil Muldoon  <pmuldoon@redhat.com>
+
+	* WatchpointFunctions.java (getTriggeredWatchpoints): New.
+
 2008-06-05  Phil Muldoon  <pmuldoon@redhat.com>
 
 	* WatchpointFunctions.java (getWatchpointMinLength): New.	
diff --git a/frysk-core/frysk/isa/watchpoints/WatchpointFunctions.java b/frysk-core/frysk/isa/watchpoints/WatchpointFunctions.java
index 994d0cb..2196016 100644
--- a/frysk-core/frysk/isa/watchpoints/WatchpointFunctions.java
+++ b/frysk-core/frysk/isa/watchpoints/WatchpointFunctions.java
@@ -42,6 +42,7 @@ package frysk.isa.watchpoints;
 
 import java.util.ArrayList;
 import java.util.List;
+
 import frysk.proc.Task;
 
 public abstract class WatchpointFunctions  {
@@ -107,13 +108,27 @@ public abstract class WatchpointFunctions  {
      **/
     public List getAllWatchpoints(Task task) {
 	List listOfWP = new ArrayList();
-	for (int i=0; i<getWatchpointCount(); i++) {
+	for (int i=0; i<getWatchpointCount(); i++) 
 	    listOfWP.add(readWatchpoint(task,i));
-	}
 	return listOfWP;   
     }
 
     /**
+     * Returns all the triggeed watchpoints k
+     *
+     * @param task - task on which to delete a watchpoint.
+     *
+     * @return List- List of watchpoints
+     *
+     **/
+    public ArrayList getTriggeredWatchpoints(Task task) {
+	ArrayList listOfWP = new ArrayList();
+	for (int i=0; i<getWatchpointCount(); i++) 
+	    if (hasWatchpointTriggered(task, i)) 
+		listOfWP.add(readWatchpoint(task,i));
+	return listOfWP;   
+    }
+    /**
      * Reads the Debug control register.
      *
      * @param task - task to read the debug control
diff --git a/frysk-core/frysk/proc/live/ChangeLog b/frysk-core/frysk/proc/live/ChangeLog
index 61ffa17..0d40328 100644
--- a/frysk-core/frysk/proc/live/ChangeLog
+++ b/frysk-core/frysk/proc/live/ChangeLog
@@ -1,3 +1,8 @@
+2008-06-16  Phil Muldoon  <pmuldoon@redhat.com>
+
+	* LinuxPtraceTaskState.java (Running.checkWatchpoint): Rewrite to use
+	WatchpointFunctions.getTriggeredWatchpoints().
+
 2008-06-12  Andrew Cagney  <cagney@redhat.com>
 
 	* LinuxPtraceProc.java (getExe()): Delete.
diff --git a/frysk-core/frysk/proc/live/LinuxPtraceTaskState.java b/frysk-core/frysk/proc/live/LinuxPtraceTaskState.java
index a819b9a..88286dc 100644
--- a/frysk-core/frysk/proc/live/LinuxPtraceTaskState.java
+++ b/frysk-core/frysk/proc/live/LinuxPtraceTaskState.java
@@ -39,18 +39,20 @@
 
 package frysk.proc.live;
 
-import frysk.sys.SignalSet;
-import frysk.sys.proc.Status;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
 import frysk.isa.watchpoints.WatchpointFunctionFactory;
 import frysk.isa.watchpoints.WatchpointFunctions;
-import frysk.proc.TaskObserver;
-import frysk.proc.Observer;
 import frysk.proc.Observable;
-import java.util.Collection;
-import java.util.Iterator;
-import frysk.sys.Signal;
+import frysk.proc.Observer;
+import frysk.proc.TaskObserver;
 import frysk.rsl.Log;
 import frysk.rsl.LogFactory;
+import frysk.sys.Signal;
+import frysk.sys.SignalSet;
+import frysk.sys.proc.Status;
 
 /**
  * A Linux Task's State tracked using PTRACE.
@@ -938,15 +940,15 @@ abstract class LinuxPtraceTaskState extends State {
 	    if (watchpointFunction == null) {
 		return blockers;
 	    }
-	    for (int i=0; i<watchpointFunction.getWatchpointCount();  i++) {
-		// Test if a watchpoint has fired
-		if (watchpointFunction.hasWatchpointTriggered(task, i)) {
-		    if (blockers == -1)
-			blockers = 0;
-		    frysk.isa.watchpoints.Watchpoint trigger = watchpointFunction.readWatchpoint(task, i);
-		    blockers += task.notifyWatchpoint(trigger.getAddress(), trigger.getRange(), trigger.isWriteOnly());
-		    watchpointFunction.resetWatchpoint(task, i);
-		}
+	    
+	    List triggeredWatchpoints = watchpointFunction.getTriggeredWatchpoints(task);
+	    Iterator i = triggeredWatchpoints.iterator();
+	    while (i.hasNext()) {
+		frysk.isa.watchpoints.Watchpoint wp = (frysk.isa.watchpoints.Watchpoint) i.next();
+		if (blockers == -1)
+		    blockers = 0;
+		blockers += task.notifyWatchpoint(wp.getAddress(), wp.getRange(), wp.isWriteOnly());
+		watchpointFunction.resetWatchpoint(task, wp.getRegister());
 	    }
 	    
 	    return blockers;


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]