From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13828 invoked by alias); 7 Apr 2008 15:24:20 -0000 Received: (qmail 13818 invoked by uid 22791); 7 Apr 2008 15:24:19 -0000 X-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_74,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 07 Apr 2008 15:24:02 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m37FO0OH023125 for ; Mon, 7 Apr 2008 11:24:00 -0400 Received: from pobox-2.corp.redhat.com (pobox-2.corp.redhat.com [10.11.255.15]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m37FNxAQ027475 for ; Mon, 7 Apr 2008 11:23:59 -0400 Received: from localhost.localdomain (vpn-14-68.rdu.redhat.com [10.11.14.68]) by pobox-2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m37FNvuQ003206 for ; Mon, 7 Apr 2008 11:23:58 -0400 Message-ID: <47FA3C8C.6010201@redhat.com> Date: Tue, 08 Apr 2008 13:17:00 -0000 From: Phil Muldoon User-Agent: Thunderbird 2.0.0.12 (X11/20080226) MIME-Version: 1.0 To: frysk@sourceware.org Subject: Re: [SCM] master: Reset watchpoint after noting trigger. References: <20080407152154.11576.qmail@sourceware.org> In-Reply-To: <20080407152154.11576.qmail@sourceware.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 X-IsSubscribed: yes Mailing-List: contact frysk-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-owner@sourceware.org X-SW-Source: 2008-q2/txt/msg00035.txt.bz2 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 > Date: Mon Apr 7 16:20:55 2008 +0100 > > Reset watchpoint after noting trigger. > > 2008-04-07 Phil Muldoon > > * WatchpointFunctions.java (resetWatchpoint): New. > * IA32WatchpointFunctions.java (resetWatchpoint): Implement. > * X8664WatchpointFunctions.java (resetWatchpoint): Ditto. > > 2008-04-07 Phil Muldoon > > * 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 > + > + * WatchpointFunctions.java (resetWatchpoint): New. > + * IA32WatchpointFunctions.java (resetWatchpoint): Implement. > + * X8664WatchpointFunctions.java (resetWatchpoint): Ditto. > + > 2008-04-04 Phil Muldoon > > * 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 > + > + * LinuxPtraceTaskState.java (Stepping.handleTrappedEvent): Reset > + watchpoint after noting trigger. > + (Running.handleTrappedEvent): Ditto. > + > 2008-04-07 Mark Wielaard > > * 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 >