public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
* [SCM]  master: Only notify watchpoint observers that have been triggered.
@ 2008-04-22  8:12 pmuldoon
  0 siblings, 0 replies; only message in thread
From: pmuldoon @ 2008-04-22  8:12 UTC (permalink / raw)
  To: frysk-cvs

The branch, master has been updated
       via  698d437d536d29ef47d59441c0dd88e8616e86a1 (commit)
      from  25c50d7c90d78aeb0260139293eeab2b8d1eec5c (commit)

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

- Log -----------------------------------------------------------------
commit 698d437d536d29ef47d59441c0dd88e8616e86a1
Author: Phil Muldoon <pmuldoon@redhat.com>
Date:   Tue Apr 22 09:12:00 2008 +0100

    Only notify watchpoint observers that have been triggered.
    
    2008-04-22  Phil Muldoon  <pmuldoon@redhat.com>
    
    	* LinuxPtraceTaskState.java (Running.checkWatchpoint): Check
    	write state on notify.
    	* LinuxPtraceTask.java (notifyWatchpoint): Collect only
    	watchpoints that have been triggered, then notify.
    	* LinuxPtraceProc.java (LinuxPtraceProc): Wide watchpoint scope
    	to protected.

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

Summary of changes:
 frysk-core/frysk/proc/live/ChangeLog               |    9 +++++++++
 frysk-core/frysk/proc/live/LinuxPtraceProc.java    |    2 +-
 frysk-core/frysk/proc/live/LinuxPtraceTask.java    |   15 +++++++++------
 .../frysk/proc/live/LinuxPtraceTaskState.java      |    2 +-
 4 files changed, 20 insertions(+), 8 deletions(-)

First 500 lines of diff:
diff --git a/frysk-core/frysk/proc/live/ChangeLog b/frysk-core/frysk/proc/live/ChangeLog
index 9d495c6..6a549ac 100644
--- a/frysk-core/frysk/proc/live/ChangeLog
+++ b/frysk-core/frysk/proc/live/ChangeLog
@@ -1,3 +1,12 @@
+2008-04-22  Phil Muldoon  <pmuldoon@redhat.com>
+
+	* LinuxPtraceTaskState.java (Running.checkWatchpoint): Check
+	write state on notify.
+	* LinuxPtraceTask.java (notifyWatchpoint): Collect only
+	watchpoints that have been triggered, then notify.
+	* LinuxPtraceProc.java (LinuxPtraceProc): Wide watchpoint scope
+	to protected.
+	
 2008-04-21  Mark Wielaard  <mwielaard@redhat.com>
 
 	* BreakpointAddresses.java: Mark class and methods package private.
diff --git a/frysk-core/frysk/proc/live/LinuxPtraceProc.java b/frysk-core/frysk/proc/live/LinuxPtraceProc.java
index 14e1e00..621d343 100644
--- a/frysk-core/frysk/proc/live/LinuxPtraceProc.java
+++ b/frysk-core/frysk/proc/live/LinuxPtraceProc.java
@@ -669,7 +669,7 @@ public class LinuxPtraceProc extends LiveProc {
     }
 
     // List and manager for Watchpoints within a task.
-    private final WatchpointAddresses watchpoints;
+    protected final WatchpointAddresses watchpoints;
     
     /**
      * (Internal) Tell the process to add the specified Watch
diff --git a/frysk-core/frysk/proc/live/LinuxPtraceTask.java b/frysk-core/frysk/proc/live/LinuxPtraceTask.java
index 397f69b..06ba6a2 100644
--- a/frysk-core/frysk/proc/live/LinuxPtraceTask.java
+++ b/frysk-core/frysk/proc/live/LinuxPtraceTask.java
@@ -550,12 +550,15 @@ public class LinuxPtraceTask extends LiveTask {
      * Notify all Watchpoint observers of the triggered watchpoint. 
      * Return the number of blocking observers, or 0 if nothing blocks.
      */
-    int notifyWatchpoint(long address, int length) {
-	for (Iterator i = watchObservers.iterator(); i.hasNext();) {
-	    TaskObserver.Watch observer = (TaskObserver.Watch) i.next();
-	    if (observer.updateHit(this, address, length) == Action.BLOCK) {
-		blockers.add(observer);
-	    }
+    int notifyWatchpoint(long address, int  length, boolean writeOnly) {
+	LinuxPtraceProc proc  = (LinuxPtraceProc) getProc();
+	Collection observers = proc.watchpoints.getWatchObservers(this, address, length, writeOnly);
+	
+	for (Iterator z = observers.iterator(); z.hasNext();) {
+		TaskObserver.Watch observer = (TaskObserver.Watch) z.next();
+		if (observer.updateHit(this, address, length) == Action.BLOCK) {
+		    blockers.add(observer);
+		}
 	}
 	return blockers.size();
     }
diff --git a/frysk-core/frysk/proc/live/LinuxPtraceTaskState.java b/frysk-core/frysk/proc/live/LinuxPtraceTaskState.java
index 50ebabd..07323db 100644
--- a/frysk-core/frysk/proc/live/LinuxPtraceTaskState.java
+++ b/frysk-core/frysk/proc/live/LinuxPtraceTaskState.java
@@ -930,7 +930,7 @@ abstract class LinuxPtraceTaskState extends State {
 		    if (blockers == -1)
 			blockers = 0;
 		    frysk.isa.watchpoints.Watchpoint trigger = watchpointFunction.readWatchpoint(task, i);
-		    blockers += task.notifyWatchpoint(trigger.getAddress(), trigger.getRange());
+		    blockers += task.notifyWatchpoint(trigger.getAddress(), trigger.getRange(), trigger.isWriteOnly());
 		    watchpointFunction.resetWatchpoint(task, i);
 		}
 	    }


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


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

only message in thread, other threads:[~2008-04-22  8:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-22  8:12 [SCM] master: Only notify watchpoint observers that have been triggered pmuldoon

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).