public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
From: tthomas@sourceware.org
To: frysk-cvs@sourceware.org
Subject: [SCM]  master: Fixes bz#6633. Dislay message if value unchanged before and after watch hit.
Date: Tue, 17 Jun 2008 15:32:00 -0000	[thread overview]
Message-ID: <20080617153234.30182.qmail@sourceware.org> (raw)

The branch, master has been updated
       via  a9edfdc3af7ed0d14c1dd2108817bb578df5a2bb (commit)
      from  9cdb46341ee8c766593debd5b3a43f2715b41bc6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit a9edfdc3af7ed0d14c1dd2108817bb578df5a2bb
Author: Teresa Thomas <tthomas@redhat.com>
Date:   Tue Jun 17 11:33:28 2008 -0400

    Fixes bz#6633. Dislay message if value unchanged before and after watch hit.
    
    frysk-core/frysk/hpd/ChangeLog:
    2008-06-17  Teresa Thomas  <tthomas@redhat.com>
    
    	* WatchObserverInstaller.java
    	(WatchpointObserver.updateHit): Print message if value
    	unchanged before and after access.
    	(install): Throw exception if numberOfObservers
    	calculated is 0.
    
    frysk-core/frysk/pkglibdir/ChangeLog:
    2008-06-17 Teresa Thomas <tthomas@redhat.com>
    
    	* funit-ctypes.c: Write to float_.
    
    frysk-core/frysk/rt/ChangeLog:
    2008-06-17  Teresa Thomas  <tthomas@redhat.com>
    
    	* TestWatchCommand.java (testWritePrevValue): New test.

-----------------------------------------------------------------------

Summary of changes:
 frysk-core/frysk/hpd/ChangeLog                  |    4 +++
 frysk-core/frysk/hpd/TestWatchCommand.java      |   25 ++++++++++++++++++++++-
 frysk-core/frysk/pkglibdir/ChangeLog            |    6 ++++-
 frysk-core/frysk/pkglibdir/funit-ctypes.c       |    3 +-
 frysk-core/frysk/rt/ChangeLog                   |    8 +++++++
 frysk-core/frysk/rt/WatchObserverInstaller.java |   11 +++++++++-
 6 files changed, 53 insertions(+), 4 deletions(-)

First 500 lines of diff:
diff --git a/frysk-core/frysk/hpd/ChangeLog b/frysk-core/frysk/hpd/ChangeLog
index 1110715..5678226 100644
--- a/frysk-core/frysk/hpd/ChangeLog
+++ b/frysk-core/frysk/hpd/ChangeLog
@@ -1,3 +1,7 @@
+2008-06-17  Teresa Thomas  <tthomas@redhat.com>
+
+	* TestWatchCommand.java (testWritePrevValue): New test.
+	
 2008-06-12  Andrew Cagney  <cagney@redhat.com>
 
 	* CLI.java (nasty()): Delete.
diff --git a/frysk-core/frysk/hpd/TestWatchCommand.java b/frysk-core/frysk/hpd/TestWatchCommand.java
index ec271a3..c52a756 100644
--- a/frysk-core/frysk/hpd/TestWatchCommand.java
+++ b/frysk-core/frysk/hpd/TestWatchCommand.java
@@ -220,7 +220,30 @@ public class TestWatchCommand extends TestLib {
       e.close();     
   }
 
-  
+  /*
+   * Test to check if user notified when value being
+   * written to is the same as previous value.
+   */
+  public void testWritePrevValue() {
+      e = new HpdTestbed();
+      e.sendCommandExpectPrompt("load " + Prefix.pkgLibFile("funit-ctypes").getPath(),
+                                "Loaded executable file.*");
+      e.send("break main\n");	
+      e.expect("breakpoint.*" + prompt);
+      e.send("run\n");
+      e.expect("Attached to process ([0-9]+).*"); 
+      
+      e.send("watch float_\n"); 
+      e.expect(".*Watchpoint set: float_.*");
+      
+      e.send("go\n"); 
+      e.expect(".*Note: Value unchanged before and after access.*");
+      
+      e.send("quit\n");
+      e.expect("Quitting\\.\\.\\.");
+      e.close();        
+  }
+
   private Task getStoppedTask() {
       return this.getStoppedTask("funit-ctypes");
   }
diff --git a/frysk-core/frysk/pkglibdir/ChangeLog b/frysk-core/frysk/pkglibdir/ChangeLog
index 181dd43..0c4b20f 100644
--- a/frysk-core/frysk/pkglibdir/ChangeLog
+++ b/frysk-core/frysk/pkglibdir/ChangeLog
@@ -1,3 +1,7 @@
+2008-06-17 Teresa Thomas <tthomas@redhat.com>
+
+	* funit-ctypes.c: Write to float_.
+	
 2008-06-06  Sami Wagiaalla  <swagiaal@redhat.com>
 
 	* funit-2threads.c: New test program.
@@ -6,7 +10,7 @@
 
 	* funit-raise.S: Fix ADD parameter order.
 
-2007-05-23 Teresa Thomas <tthomas@redhat.com>
+2008-05-23 Teresa Thomas <tthomas@redhat.com>
 
 	* funit-ctypes.c: New file.
 	
diff --git a/frysk-core/frysk/pkglibdir/funit-ctypes.c b/frysk-core/frysk/pkglibdir/funit-ctypes.c
index 6a5e3fb..9337ab6 100644
--- a/frysk-core/frysk/pkglibdir/funit-ctypes.c
+++ b/frysk-core/frysk/pkglibdir/funit-ctypes.c
@@ -44,7 +44,7 @@
 
 int array[4];
 int bigArray[9];
-float float_ = 0.0;
+float float_ = 1.9;
 double double_ = 0.0;
 long long long_long = 111;
 char char_ = 'A';
@@ -56,6 +56,7 @@ int main(int argc, char* argv[])
      array[k] = k;
 
   double_ = 12.0;
+  float_ = 1.9;
   long_long = 0x11223344aabbccddLL;
   char_ = 'B';
   	   
diff --git a/frysk-core/frysk/rt/ChangeLog b/frysk-core/frysk/rt/ChangeLog
index 2962ba9..b438129 100644
--- a/frysk-core/frysk/rt/ChangeLog
+++ b/frysk-core/frysk/rt/ChangeLog
@@ -1,3 +1,11 @@
+2008-06-17  Teresa Thomas  <tthomas@redhat.com>
+
+	* WatchObserverInstaller.java 
+	(WatchpointObserver.updateHit): Print message if value 
+	unchanged before and after access.
+	(install): Throw exception if numberOfObservers 
+	calculated is 0.
+	
 2008-06-11  Teresa Thomas  <tthomas@redhat.com>
 
 	* WatchObserverInstaller.java (install): Use Location.length()
diff --git a/frysk-core/frysk/rt/WatchObserverInstaller.java b/frysk-core/frysk/rt/WatchObserverInstaller.java
index 635709c..1d376b3 100644
--- a/frysk-core/frysk/rt/WatchObserverInstaller.java
+++ b/frysk-core/frysk/rt/WatchObserverInstaller.java
@@ -102,6 +102,11 @@ public class WatchObserverInstaller {
 	// to completely watch the variable.
 	int numberOfObservers = (int)Math.ceil((double)variableLength/
 	                           	       (double)maxWatchLength);
+	
+	if (numberOfObservers == 0) {
+	    throw new RuntimeException ("Error: Watchpoint cannot be installed");
+	}
+	
 	int observerNumber = 1;
 	
 	// Add watchpoint observers to task. 
@@ -156,11 +161,15 @@ public class WatchObserverInstaller {
 	public Action updateHit(Task task, long address, int length) {
 
 	    String newValue = expr.getValue().toPrint
-	    (Format.NATURAL, task.getMemory());
+	                        (Format.NATURAL, task.getMemory());
 
 	    String watchMessage = "Watchpoint hit: " + exprString + "\n" +
 	                          "   Value before hit = " + oldValue + "\n" +
 	                          "   Value after  hit = " + newValue + "\n";
+	    
+	    if (oldValue.equals(newValue)) {
+		watchMessage += "Note: Value unchanged before and after access\n";
+	    }
 	    // Remember the previous value
 	    oldValue = newValue;
 


hooks/post-receive
--
frysk system monitor/debugger


                 reply	other threads:[~2008-06-17 15:32 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=20080617153234.30182.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).