public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
* [SCM]  master: Print pointers correctly on a watch hit.
@ 2008-04-17 21:36 tthomas
  0 siblings, 0 replies; only message in thread
From: tthomas @ 2008-04-17 21:36 UTC (permalink / raw)
  To: frysk-cvs

The branch, master has been updated
       via  381a90e5676cd8616a0ea5a125771304946af16a (commit)
      from  8c7084e590bc33cd6f81bd0f0f62192a120ae004 (commit)

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

- Log -----------------------------------------------------------------
commit 381a90e5676cd8616a0ea5a125771304946af16a
Author: Teresa Thomas <tthomas@redhat.com>
Date:   Thu Apr 17 17:34:19 2008 -0400

    Print pointers correctly on a watch hit.
    
    frysk-core/frysk/hpd/ChangeLog:
    2008-04-17  Teresa Thomas  <tthomas@redhat.com>
    
    	* WatchCommand.java (interpret): Pass task memory to toPrint.

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

Summary of changes:
 frysk-core/frysk/hpd/ChangeLog         |    9 +++++++++
 frysk-core/frysk/hpd/WatchCommand.java |   30 +++++++++++++++++-------------
 2 files changed, 26 insertions(+), 13 deletions(-)

First 500 lines of diff:
diff --git a/frysk-core/frysk/hpd/ChangeLog b/frysk-core/frysk/hpd/ChangeLog
index 7a78133..c133bcc 100644
--- a/frysk-core/frysk/hpd/ChangeLog
+++ b/frysk-core/frysk/hpd/ChangeLog
@@ -8,6 +8,15 @@
 
 2008-04-17  Teresa Thomas  <tthomas@redhat.com>
 
+	* WatchCommand.java (interpret): Pass task memory to toPrint().
+
+2008-04-17  Teresa Thomas  <tthomas@redhat.com>
+
+	* WatchCommand.java (interpret): Add memory error
+	handling.
+
+2008-04-17  Teresa Thomas  <tthomas@redhat.com>
+
 	* WatchCommand.java (WatchpointObserver.updateHit): 
 	  Use SteppingEngine.blockedByActionPoint
 	  
diff --git a/frysk-core/frysk/hpd/WatchCommand.java b/frysk-core/frysk/hpd/WatchCommand.java
index 5a8170f..ad15faa 100644
--- a/frysk-core/frysk/hpd/WatchCommand.java
+++ b/frysk-core/frysk/hpd/WatchCommand.java
@@ -46,7 +46,7 @@ import frysk.expr.Expression;
 import frysk.proc.Action;
 import frysk.proc.Task;
 import frysk.proc.TaskObserver;
-import frysk.value.Value;
+import frysk.value.Format;
 
 class WatchCommand extends ParameterizedCommand {
 
@@ -99,13 +99,16 @@ class WatchCommand extends ParameterizedCommand {
 	    // XXX: will fail for non-contiguos memory and registers 
 	    // XXX: Add error handling
 	    long address = expr.getLocation().getAddress();
-	    
+
 	    // XXX: getValue may modify inferior.
-	    String oldValue = expr.getValue().toPrint();
-	    
+	    String oldValueStr = expr.getValue().toPrint
+	                        (Format.NATURAL, task.getMemory());
+
 	    // Add a watch point observer to task.
-	    WatchpointObserver wpo = new WatchpointObserver(expr, cli, expressionStr, oldValue);
-	    task.requestAddWatchObserver(wpo, address, expr.getType().getSize(), writeOnly);
+	    WatchpointObserver wpo = new WatchpointObserver
+	                             (expr, cli, expressionStr, oldValueStr);
+	    task.requestAddWatchObserver
+	         (wpo, address, expr.getType().getSize(), writeOnly);		
 	}       
     }
     
@@ -115,25 +118,26 @@ class WatchCommand extends ParameterizedCommand {
         Expression expr;
 	CLI cli;
 	String exprStr;
-	String oldValue;
+	String oldValueStr;
 
-	WatchpointObserver(Expression expr, CLI cli, String exprStr, String oldValue) {
+	WatchpointObserver(Expression expr, CLI cli, String exprStr, String oldValueStr) {
 	    this.expr = expr;
 	    this.cli = cli;
 	    this.exprStr = exprStr;
-	    this.oldValue = oldValue;
+	    this.oldValueStr = oldValueStr;
 
 	}
 	public Action updateHit(Task task, long address, int length) {
 	    
-	    Value newValue = expr.getValue();
+	    String newValueStr = expr.getValue().toPrint
+	                         (Format.NATURAL, task.getMemory());
 	    cli.outWriter.println("Watchpoint hit: " + exprStr); 
 	    cli.outWriter.println(); 
-	    cli.outWriter.println("   Value before hit = " + oldValue);
-	    cli.outWriter.println("   Value after  hit = " + newValue.toPrint());
+	    cli.outWriter.println("   Value before hit = " + oldValueStr);
+	    cli.outWriter.println("   Value after  hit = " + newValueStr);
 	    cli.outWriter.println(); 
 	    // Remember the previous value
-	    oldValue = newValue.toPrint();
+	    oldValueStr = newValueStr;
 
 	    cli.getSteppingEngine().blockedByActionPoint(task, this);
 	    task.requestUnblock(this);


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


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

only message in thread, other threads:[~2008-04-17 21:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-17 21:36 [SCM] master: Print pointers correctly on a watch hit 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).