From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32418 invoked by alias); 22 Apr 2008 08:12:34 -0000 Received: (qmail 32392 invoked by uid 9514); 22 Apr 2008 08:12:34 -0000 Date: Tue, 22 Apr 2008 08:12:00 -0000 Message-ID: <20080422081234.32377.qmail@sourceware.org> From: pmuldoon@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: Only notify watchpoint observers that have been triggered. X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 25c50d7c90d78aeb0260139293eeab2b8d1eec5c X-Git-Newrev: 698d437d536d29ef47d59441c0dd88e8616e86a1 Mailing-List: contact frysk-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-cvs-owner@sourceware.org Reply-To: frysk@sourceware.org X-SW-Source: 2008-q2/txt/msg00149.txt.bz2 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 Date: Tue Apr 22 09:12:00 2008 +0100 Only notify watchpoint observers that have been triggered. 2008-04-22 Phil Muldoon * 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 + + * 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 * 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