public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
From: pmuldoon@sourceware.org
To: frysk-cvs@sourceware.org
Subject: [SCM]  master: Reset watchpoint after noting trigger.
Date: Mon, 07 Apr 2008 15:21:00 -0000	[thread overview]
Message-ID: <20080407152154.11576.qmail@sourceware.org> (raw)

The branch, master has been updated
       via  9472675fd80d52cdc4f259133d0278511c0f3da9 (commit)
      from  fd38b34dcc23843a0dd48d914878a6c9b9418bae (commit)

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

- Log -----------------------------------------------------------------
commit 9472675fd80d52cdc4f259133d0278511c0f3da9
Author: Phil Muldoon <pmuldoon@redhat.com>
Date:   Mon Apr 7 16:20:55 2008 +0100

    Reset watchpoint after noting trigger.
    
    2008-04-07  Phil Muldoon  <pmuldoon@redhat.com>
    
    	* WatchpointFunctions.java (resetWatchpoint): New.
    	* IA32WatchpointFunctions.java (resetWatchpoint): Implement.
    	* X8664WatchpointFunctions.java (resetWatchpoint): Ditto.
    
    2008-04-07  Phil Muldoon  <pmuldoon@redhat.com>
    
    	* LinuxPtraceTaskState.java (Stepping.handleTrappedEvent): Reset
    	watchpoint after noting trigger.
    	(Running.handleTrappedEvent): Ditto.

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

Summary of changes:
 frysk-core/frysk/isa/watchpoints/ChangeLog         |    6 ++++++
 .../isa/watchpoints/IA32WatchpointFunctions.java   |   13 +++++++++++++
 .../frysk/isa/watchpoints/WatchpointFunctions.java |   12 ++++++++++++
 .../isa/watchpoints/X8664WatchpointFunctions.java  |   14 ++++++++++++++
 frysk-core/frysk/proc/live/ChangeLog               |    6 ++++++
 .../frysk/proc/live/LinuxPtraceTaskState.java      |    2 ++
 6 files changed, 53 insertions(+), 0 deletions(-)

First 500 lines of diff:
diff --git a/frysk-core/frysk/isa/watchpoints/ChangeLog b/frysk-core/frysk/isa/watchpoints/ChangeLog
index 4c408b4..b58ecff 100644
--- a/frysk-core/frysk/isa/watchpoints/ChangeLog
+++ b/frysk-core/frysk/isa/watchpoints/ChangeLog
@@ -1,3 +1,9 @@
+2008-04-07  Phil Muldoon  <pmuldoon@redhat.com>
+
+	* WatchpointFunctions.java (resetWatchpoint): New.
+	* IA32WatchpointFunctions.java (resetWatchpoint): Implement.
+	* X8664WatchpointFunctions.java (resetWatchpoint): Ditto.
+	
 2008-04-04  Phil Muldoon  <pmuldoon@redhat.com>
 
 	* X8664WatchpointFunctions.java (setWatchpoint): Set 2 byte watch to
diff --git a/frysk-core/frysk/isa/watchpoints/IA32WatchpointFunctions.java b/frysk-core/frysk/isa/watchpoints/IA32WatchpointFunctions.java
index c8964db..42d2fce 100644
--- a/frysk-core/frysk/isa/watchpoints/IA32WatchpointFunctions.java
+++ b/frysk-core/frysk/isa/watchpoints/IA32WatchpointFunctions.java
@@ -233,6 +233,19 @@ class IA32WatchpointFunctions extends WatchpointFunctions {
 	return (debugStatus & (1L << index)) != 0;
     }
 
+    /**
+     * Resets the appropriate bit in the debug status register
+     * after a watchpoint has triggered, thereby reseting it.
+     *
+     * @param task - task to read the debug control
+     * register from.
+     * @param index - Debug register to reset.
+     */
+    public void resetWatchpoint(Task task, int index) {
+	long debugStatus = readStatusRegister(task);	
+	debugStatus &= ~(1L << index);
+	task.setRegister(IA32Registers.DEBUG_STATUS, debugStatus);
+    }
 
     /**
      * Reads the Debug control register.
diff --git a/frysk-core/frysk/isa/watchpoints/WatchpointFunctions.java b/frysk-core/frysk/isa/watchpoints/WatchpointFunctions.java
index 0eb247a..5270459 100644
--- a/frysk-core/frysk/isa/watchpoints/WatchpointFunctions.java
+++ b/frysk-core/frysk/isa/watchpoints/WatchpointFunctions.java
@@ -126,10 +126,22 @@ public abstract class WatchpointFunctions  {
      *
      * @param task - task to read the debug control
      * register from.
+     * @param index - Debug register to check
+
      */
     public abstract boolean hasWatchpointTriggered(Task task, int index);
 
     /**
+     * Resets the appropriate bit in the debug status register
+     * after a watchpoint has triggered, thereby reseting it.
+     *
+     * @param task - task to read the debug control
+     * register from.
+     * @param index - Debug register to reset.
+     */
+    public abstract void resetWatchpoint(Task task, int index);
+
+    /**
      * Returns number of watchpoints for this architecture
      *
      * @return int number of usable watchpoints.
diff --git a/frysk-core/frysk/isa/watchpoints/X8664WatchpointFunctions.java b/frysk-core/frysk/isa/watchpoints/X8664WatchpointFunctions.java
index b227be6..11f5030 100644
--- a/frysk-core/frysk/isa/watchpoints/X8664WatchpointFunctions.java
+++ b/frysk-core/frysk/isa/watchpoints/X8664WatchpointFunctions.java
@@ -253,6 +253,20 @@ class X8664WatchpointFunctions extends WatchpointFunctions {
 	return (debugStatus & (1L << index)) != 0;
     }
 
+    /**
+     * Resets the appropriate bit in the debug status register
+     * after a watchpoint has triggered, thereby reseting it.
+     *
+     * @param task - task to read the debug control
+     * register from.
+     * @param index - Debug register to reset.
+     */
+    public void resetWatchpoint(Task task, int index) {
+	long debugStatus = readStatusRegister(task);	
+	debugStatus &= ~(1L << index);
+	task.setRegister(X8664Registers.DEBUG_STATUS, debugStatus);
+    }
+
     private boolean testBit(long register, int bitToTest) {
 	return (register & (1L << bitToTest)) != 0;
     }
diff --git a/frysk-core/frysk/proc/live/ChangeLog b/frysk-core/frysk/proc/live/ChangeLog
index 58b6fae..84dc832 100644
--- a/frysk-core/frysk/proc/live/ChangeLog
+++ b/frysk-core/frysk/proc/live/ChangeLog
@@ -1,3 +1,9 @@
+2008-04-07  Phil Muldoon  <pmuldoon@redhat.com>
+
+	* LinuxPtraceTaskState.java (Stepping.handleTrappedEvent): Reset 
+	watchpoint after noting trigger.
+	(Running.handleTrappedEvent): Ditto.
+
 2008-04-07  Mark Wielaard  <mwielaard@redhat.com>
 
 	* LinuxPtraceTaskState.java (Stepping.handleTrappedEvent):
diff --git a/frysk-core/frysk/proc/live/LinuxPtraceTaskState.java b/frysk-core/frysk/proc/live/LinuxPtraceTaskState.java
index 7d737f9..8f35740 100644
--- a/frysk-core/frysk/proc/live/LinuxPtraceTaskState.java
+++ b/frysk-core/frysk/proc/live/LinuxPtraceTaskState.java
@@ -950,6 +950,7 @@ abstract class LinuxPtraceTaskState extends State {
 		// Test if a watchpoint has fired
 		if (watchpointFunction.hasWatchpointTriggered(task, i)) {
 		    frysk.isa.watchpoints.Watchpoint trigger = watchpointFunction.readWatchpoint(task, i);
+		    watchpointFunction.resetWatchpoint(task, i);
 		    int blockers = task.notifyWatchpoint(trigger.getAddress(), trigger.getRange());
 		    if (blockers == 0)
 			return sendContinue(task, Signal.NONE);
@@ -1084,6 +1085,7 @@ abstract class LinuxPtraceTaskState extends State {
 		// Test if a watchpoint has fired
 		if (watchpointFunction.hasWatchpointTriggered(task, i)) {
 		    frysk.isa.watchpoints.Watchpoint trigger = watchpointFunction.readWatchpoint(task, i);
+		    watchpointFunction.resetWatchpoint(task, i);
 		    int blockers = task.notifyWatchpoint(trigger.getAddress(), trigger.getRange());
 		    if (blockers == 0)
 			return sendContinue(task, Signal.NONE);


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


                 reply	other threads:[~2008-04-07 15:21 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=20080407152154.11576.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).