public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
From: tthomas@sourceware.org
To: frysk-cvs@sourceware.org
Subject: [SCM]  master: Keep track of hardware watchpoints in use.
Date: Mon, 26 May 2008 20:09:00 -0000	[thread overview]
Message-ID: <20080526200924.31055.qmail@sourceware.org> (raw)

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


                 reply	other threads:[~2008-05-26 20:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080526200924.31055.qmail@sourceware.org \
    --to=tthomas@sourceware.org \
    --cc=frysk-cvs@sourceware.org \
    --cc=frysk@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).