public inbox for frysk@sourceware.org
 help / color / mirror / Atom feed
* Re: [SCM]  master: Reset watchpoint after noting trigger.
       [not found] <20080407152154.11576.qmail@sourceware.org>
@ 2008-04-08 13:17 ` Phil Muldoon
  0 siblings, 0 replies; only message in thread
From: Phil Muldoon @ 2008-04-08 13:17 UTC (permalink / raw)
  To: frysk

This commit resets the watchpoint (but does not delete it) after noting 
it has triggered. This patchlet was left over from last weeks commit. 
Apologies for missing it.

Regards

Phil

pmuldoon@sourceware.org wrote:
> 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
>   

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

only message in thread, other threads:[~2008-04-07 15:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20080407152154.11576.qmail@sourceware.org>
2008-04-08 13:17 ` [SCM] master: Reset watchpoint after noting trigger Phil Muldoon

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