From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31119 invoked by alias); 26 May 2008 20:09:25 -0000 Received: (qmail 31070 invoked by uid 9708); 26 May 2008 20:09:24 -0000 Date: Mon, 26 May 2008 20:09:00 -0000 Message-ID: <20080526200924.31055.qmail@sourceware.org> From: tthomas@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: Keep track of hardware watchpoints in use. X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: fb8fcd60afcbedee536157c09b1b77a69d7e8fa0 X-Git-Newrev: 0c0c0865bb2e2097196119f0b8149e24883ed8e4 Mailing-List: contact frysk-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-cvs-owner@sourceware.org Reply-To: frysk@sourceware.org X-SW-Source: 2008-q2/txt/msg00291.txt.bz2 The branch, master has been updated via 0c0c0865bb2e2097196119f0b8149e24883ed8e4 (commit) from fb8fcd60afcbedee536157c09b1b77a69d7e8fa0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 0c0c0865bb2e2097196119f0b8149e24883ed8e4 Author: Teresa Thomas Date: Mon May 26 16:11:23 2008 -0400 Keep track of hardware watchpoints in use. frysk-core/frysk/hpd/ChangeLog: 2008-05-26 Teresa Thomas * WatchCommand.java (watchpointsInUse): New (WatchpointObserver.addedTo): Increment watchpointsInUse. (WatchpointObserver.deletedFrom): Decrement watchpointsInUse. * TestWatchCommand.java (testWatchOversized): Update. ----------------------------------------------------------------------- Summary of changes: frysk-core/frysk/hpd/ChangeLog | 5 +++++ frysk-core/frysk/hpd/TestWatchCommand.java | 3 ++- frysk-core/frysk/hpd/WatchCommand.java | 11 +++++++---- 3 files changed, 14 insertions(+), 5 deletions(-) First 500 lines of diff: diff --git a/frysk-core/frysk/hpd/ChangeLog b/frysk-core/frysk/hpd/ChangeLog index 2487faf..adb7f00 100644 --- a/frysk-core/frysk/hpd/ChangeLog +++ b/frysk-core/frysk/hpd/ChangeLog @@ -1,5 +1,10 @@ 2008-05-26 Teresa Thomas + * WatchCommand.java (watchpointsInUse): New + (WatchpointObserver.addedTo): Increment watchpointsInUse. + (WatchpointObserver.deletedFrom): Decrement watchpointsInUse. + * TestWatchCommand.java (testWatchOversized): Update. + * TestWatchCommand.java (testBadWatch): New. 2008-05-23 Teresa Thomas diff --git a/frysk-core/frysk/hpd/TestWatchCommand.java b/frysk-core/frysk/hpd/TestWatchCommand.java index cc9cf00..f7748fb 100644 --- a/frysk-core/frysk/hpd/TestWatchCommand.java +++ b/frysk-core/frysk/hpd/TestWatchCommand.java @@ -133,7 +133,8 @@ public class TestWatchCommand extends TestLib { e.sendCommandExpectPrompt("start", "Attached to process.*"); e.send("watch bigArray\n"); - e.expect(".*Watchpoint set error: Variable size too large.*"); + e.expect(".*Watch error: Available watchpoints not sufficient " + + "to watch complete value..*"); e.send("quit\n"); e.expect("Quitting\\.\\.\\."); diff --git a/frysk-core/frysk/hpd/WatchCommand.java b/frysk-core/frysk/hpd/WatchCommand.java index 118f926..5c0a5d6 100644 --- a/frysk-core/frysk/hpd/WatchCommand.java +++ b/frysk-core/frysk/hpd/WatchCommand.java @@ -52,6 +52,7 @@ import frysk.value.Format; class WatchCommand extends ParameterizedCommand { private boolean writeOnly = true; + private static int watchpointsInUse = 0; WatchCommand() { // XXX: Add details on thread-handling when implemented @@ -108,13 +109,13 @@ class WatchCommand extends ParameterizedCommand { // Get the max length a hardware watchpoint can watch - architecture dependent int watchLength = WatchpointFunctionFactory.getWatchpointFunctions (task.getISA()).getWatchpointMaxLength(); - - // XXX: May fail for non-contiguos memory and registers + long variableAddress = expr.getLocation().getAddress(); int variableLength = expr.getType().getSize(); - if (variableLength > watchpointCount * watchLength ) - throw new RuntimeException ("Watchpoint set error: Variable size too large."); + if (variableLength > (watchpointCount-watchpointsInUse) * watchLength ) + throw new RuntimeException ("Watch error: Available watchpoints not sufficient to " + + "watch complete value."); // Calculate number of watch observers needed to completely // watch the variable. @@ -174,9 +175,11 @@ class WatchCommand extends ParameterizedCommand { public void addedTo(Object observable) { cli.outWriter.println("Watchpoint set: " + exprStr); + watchpointsInUse++; } public void deletedFrom(Object observable) { + watchpointsInUse--; } } hooks/post-receive -- frysk system monitor/debugger