public inbox for frysk-cvs@sourceware.org help / color / mirror / Atom feed
From: pmuldoon@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: Process watchpoint events as a whole rather than iterating over the whole physical range. Date: Tue, 17 Jun 2008 07:35:00 -0000 [thread overview] Message-ID: <20080617073514.19021.qmail@sourceware.org> (raw) 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
reply other threads:[~2008-06-17 7:35 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=20080617073514.19021.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: linkBe 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).