From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1027 invoked by alias); 14 Apr 2008 13:26:53 -0000 Received: (qmail 1006 invoked by uid 22791); 14 Apr 2008 13:26:50 -0000 X-Spam-Status: No, hits=-1.2 required=5.0 tests=AWL,BAYES_05,J_CHICKENPOX_46,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, 14 Apr 2008 13:26:33 +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 m3EDQVmA016791 for ; Mon, 14 Apr 2008 09:26:31 -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 m3EDQVqq024627 for ; Mon, 14 Apr 2008 09:26:31 -0400 Received: from localhost.localdomain (vpn-14-80.rdu.redhat.com [10.11.14.80]) by pobox-2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m3EDQTT3009139 for ; Mon, 14 Apr 2008 09:26:30 -0400 Message-ID: <48035B84.5040401@redhat.com> Date: Mon, 14 Apr 2008 13:31: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: Add new test testRunningAndReadOnlyWatchpoint. Adjust funit-watcjpoints.S for test. References: <20080414131653.28873.qmail@sourceware.org> In-Reply-To: <20080414131653.28873.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/msg00052.txt.bz2 pmuldoon@sourceware.org wrote: This commits add an explicit check for "read or write" watchpoints. All the other tests up until now have concentrated on "Write only" watchpoints. However, a sanity test that the "read or write" case is required. Added the test, and added a specific global variable in funit-watchpoints.S to allow this check. Regards Phil > The branch, master has been updated > via dd89b9e98efbe563cef22c6b18b9b135523a8205 (commit) > from 05a02786605b522770d51c9c5cf5bcd503ce24ad (commit) > > Those revisions listed above that are new to this repository have > not appeared on any other notification email. > > - Log ----------------------------------------------------------------- > commit dd89b9e98efbe563cef22c6b18b9b135523a8205 > Author: Phil Muldoon > Date: Mon Apr 14 14:15:43 2008 +0100 > > Add new test testRunningAndReadOnlyWatchpoint. Adjust funit-watcjpoints.S for test. > > 2008-04-14 Phil Muldoon > > * TestTaskObserverWatchpoint.java (testRunningAndReadOnlyWatchpoint): New. > > 2008-04-14 Phil Muldoon > > * funit-watchpoint.S: Add new read_only WORD > symbol. Read it. > > ----------------------------------------------------------------------- > > Summary of changes: > frysk-core/frysk/pkglibdir/ChangeLog | 5 ++ > frysk-core/frysk/pkglibdir/funit-watchpoint.S | 12 +++-- > frysk-core/frysk/proc/ChangeLog | 4 ++ > .../frysk/proc/TestTaskObserverWatchpoint.java | 57 +++++++++++++++++++- > 4 files changed, 72 insertions(+), 6 deletions(-) > > First 500 lines of diff: > diff --git a/frysk-core/frysk/pkglibdir/ChangeLog b/frysk-core/frysk/pkglibdir/ChangeLog > index 23fd5b2..d0090ce 100644 > --- a/frysk-core/frysk/pkglibdir/ChangeLog > +++ b/frysk-core/frysk/pkglibdir/ChangeLog > @@ -1,3 +1,8 @@ > +2008-04-14 Phil Muldoon > + > + * funit-watchpoint.S: Add new read_only WORD > + symbol. Read it. > + > 2008-04-08 Andrew Cagney > > * funit-threads.xml-in: Add version information. > diff --git a/frysk-core/frysk/pkglibdir/funit-watchpoint.S b/frysk-core/frysk/pkglibdir/funit-watchpoint.S > index e03093e..cfb0f39 100644 > --- a/frysk-core/frysk/pkglibdir/funit-watchpoint.S > +++ b/frysk-core/frysk/pkglibdir/funit-watchpoint.S > @@ -60,17 +60,17 @@ LOAD_IMMED_BYTE (REG3, 0x77) > > // Clear the decks ... > NOP > -NOP > -NOP > - > // Write 0x77 into the location of source (held by GPR1) > STORE_WORD(REG3, REG1) > - > -// Clear the decks .... > NOP > + > NOP > +// Read read_only memory, and copy it to source > +LOAD_IMMED_WORD(REG3, read_only) > +STORE_WORD(REG3, REG1) > NOP > > + > // End. And exit > MAIN_EPILOGUE(0) > FUNCTION_RETURN(main,0) > @@ -80,4 +80,6 @@ FUNCTION_END(main,0) > .globl source > WORD(source, 0x99) > > +.globl read_only > +WORD(read_only, 0x01) > > diff --git a/frysk-core/frysk/proc/ChangeLog b/frysk-core/frysk/proc/ChangeLog > index c6cdbd1..63785a8 100644 > --- a/frysk-core/frysk/proc/ChangeLog > +++ b/frysk-core/frysk/proc/ChangeLog > @@ -1,3 +1,7 @@ > +2008-04-14 Phil Muldoon > + > + * TestTaskObserverWatchpoint.java (testRunningAndReadOnlyWatchpoint): New. > + > 2008-04-10 Phil Muldoon > > * TestTaskObserverWatchpoint.java (testAddthenDeleteWatchpoint): New Test. > diff --git a/frysk-core/frysk/proc/TestTaskObserverWatchpoint.java b/frysk-core/frysk/proc/TestTaskObserverWatchpoint.java > index 59b8c33..2fde8c2 100644 > --- a/frysk-core/frysk/proc/TestTaskObserverWatchpoint.java > +++ b/frysk-core/frysk/proc/TestTaskObserverWatchpoint.java > @@ -177,7 +177,62 @@ extends TestLib > > } > > - > + > + // This test case tests whether 'read or write' watchpoints are caught when a task is in a straight > + // "running" condition. In this test: set up the 'read or write' watchpoint, set up > + // a terminated observer to guard the watchpoint was caught, and simply set the task to run. > + // If the watchpoint observer is called on address read, and the test is blocked then the > + // test passes. If the process terminates and the watchpoint is not caught, > + // then this signified an error condition. > + public void testRunningAndReadOnlyWatchpoint () { > + if (unresolvedOnPPC(5991)) > + return; > + > + DaemonBlockedAtEntry ackProc = new DaemonBlockedAtEntry( > + Config.getPkgLibFile("funit-watchpoint")); > + assertNotNull(ackProc); > + > + // Get Proc/Task. > + Proc proc = ackProc.getMainTask().getProc(); > + Task task = proc.getMainTask(); > + > + // Watch for any unexpected terminations of the child process. > + TerminatedObserver to = new TerminatedObserver(); > + task.requestAddTerminatedObserver(to); > + > + // Break at main > + long mainAddress = getGlobalSymbolAddress(task, "main"); > + CodeObserver co = new CodeObserver(); > + task.requestAddCodeObserver(co, mainAddress); > + ackProc.requestUnblock(); > + assertRunUntilStop("Run to main"); > + > + // Find Variable source for watch > + long address = getGlobalSymbolAddress(task,"read_only"); > + > + // Add watch observer. Set it to fire on read OR write. > + WatchObserver watch = new WatchObserver(task, address, 4); > + task.requestAddWatchObserver(watch, address, 4, false); > + > + task.requestUnblock(co); > + assertRunUntilStop("Run and test watchpoint "); > + > + // Make sure it triggered. > + assertTrue("added", watch.added); > + assertEquals("hit code", 1, watch.hit); > + > + // Delete both observers. > + task.requestDeleteCodeObserver(co, mainAddress); > + task.requestDeleteWatchObserver(watch, address, 4, true); > + runPending(); > + > + // Verify they were removed. > + assertTrue("deleted watch", watch.deleted); > + assertTrue("deleted code", co.deleted); > + assertEquals("hit code", 1, watch.hit); > + > + } > + > // This test tests that a watchpoint is properly deleted: from the othe observer lists > // and the hardware. In this case, if the watchpoint is caught, then it fails. It should have > // been deleted. This test adds the watchpoint, then runs to main, then deletes the watchpoint. > > > hooks/post-receive > -- > frysk system monitor/debugger >