public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
* [SCM]  master: Keep track of hardware watchpoints in use.
@ 2008-05-26 20:09 tthomas
  0 siblings, 0 replies; only message in thread
From: tthomas @ 2008-05-26 20:09 UTC (permalink / raw)
  To: frysk-cvs

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 <tthomas@redhat.com>
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  <tthomas@redhat.com>
    
    	* 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  <tthomas@redhat.com>
 
+	* 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  <tthomas@redhat.com>
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


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

only message in thread, other threads:[~2008-05-26 20:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-26 20:09 [SCM] master: Keep track of hardware watchpoints in use tthomas

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