public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
From: pmuldoon@sourceware.org
To: frysk-cvs@sourceware.org
Subject: [SCM]  master: Only notify watchpoint observers that have been triggered.
Date: Tue, 22 Apr 2008 08:12:00 -0000	[thread overview]
Message-ID: <20080422081234.32377.qmail@sourceware.org> (raw)

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


                 reply	other threads:[~2008-04-22  8:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20080422081234.32377.qmail@sourceware.org \
    --to=pmuldoon@sourceware.org \
    --cc=frysk-cvs@sourceware.org \
    --cc=frysk@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).