public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
* [SCM]  master: Catch exceptions on memory errors while printing pointers.
@ 2007-11-29 18:08 tthomas
  0 siblings, 0 replies; only message in thread
From: tthomas @ 2007-11-29 18:08 UTC (permalink / raw)
  To: frysk-cvs

The branch, master has been updated
       via  bf8d1a49cb3923ca81180d014b9fd03eb699a10a (commit)
      from  31a3d5e95b53ff38962a6cd09ec526b28119c3ab (commit)

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

- Log -----------------------------------------------------------------
commit bf8d1a49cb3923ca81180d014b9fd03eb699a10a
Author: Teresa Thomas <tthomas@redhat.com>
Date:   Thu Nov 29 13:04:53 2007 -0500

    Catch exceptions on memory errors while printing pointers.
    
    frysk-core/frysk/value/ChangeLog
    2007-11-29  Teresa Thomas  <tthomas@redhat.com>
    
    	* PointerType.java (toPrint): Catch exception
    	on memory error.
    
    frysk-core/frysk/debuginfo/ChangeLog
    2007-11-29  Teresa Thomas  <tthomas@redhat.com>
    
    	* PieceLocation.java (pieceOf): Modify exception messages.
    	(indexOf): Ditto.

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

Summary of changes:
 frysk-core/frysk/debuginfo/ChangeLog          |    5 +++++
 frysk-core/frysk/debuginfo/PieceLocation.java |    4 ++--
 frysk-core/frysk/pkglibdir/funit-addresses.c  |    3 ++-
 frysk-core/frysk/value/ChangeLog              |    7 ++++++-
 frysk-core/frysk/value/PointerType.java       |   17 ++++++++++++-----
 5 files changed, 27 insertions(+), 9 deletions(-)

First 500 lines of diff:
diff --git a/frysk-core/frysk/debuginfo/ChangeLog b/frysk-core/frysk/debuginfo/ChangeLog
index 104cfd7..86b763b 100644
--- a/frysk-core/frysk/debuginfo/ChangeLog
+++ b/frysk-core/frysk/debuginfo/ChangeLog
@@ -1,3 +1,8 @@
+2007-11-29  Teresa Thomas  <tthomas@redhat.com>
+
+	* PieceLocation.java (pieceOf): Modify exception messages.
+	(indexOf): Ditto.
+
 2007-11-29  Andrew Cagney  <cagney@redhat.com>
 
 	* DwarfRegisterMapFactory.java: Update; RegisterMap constructor
diff --git a/frysk-core/frysk/debuginfo/PieceLocation.java b/frysk-core/frysk/debuginfo/PieceLocation.java
index 6f888fb..b129e77 100644
--- a/frysk-core/frysk/debuginfo/PieceLocation.java
+++ b/frysk-core/frysk/debuginfo/PieceLocation.java
@@ -125,7 +125,7 @@ extends Location
 	    else
 		indexCount += len;
 	}
-	throw new RuntimeException("Index out of range for offset " + offset);	
+	throw new RuntimeException("Out of range.");	
     }
 
     /**
@@ -155,7 +155,7 @@ extends Location
 	    else
 		indexCount += len;
 	}
-	throw new RuntimeException("Piece out of range for offset " + offset);	
+	throw new RuntimeException("Out of range.");	
     }
 
     /**
diff --git a/frysk-core/frysk/pkglibdir/funit-addresses.c b/frysk-core/frysk/pkglibdir/funit-addresses.c
index cf057b9..3a7fb88 100644
--- a/frysk-core/frysk/pkglibdir/funit-addresses.c
+++ b/frysk-core/frysk/pkglibdir/funit-addresses.c
@@ -63,7 +63,8 @@ int twoD[2][3] = { {99, 88, 77},
                  };  
 int oneD[] = { 4, 3, 2, 1};                
 char* string = "hello world";
-int* ptr = NULL;
+char* char_ptr = NULL;
+int* int_ptr = NULL;
 char* ptrStrings[] = {"zero", "one", "two", "three"};
 int** dynamicTwoD = NULL;
 int*  dynamicOneD = NULL;
diff --git a/frysk-core/frysk/value/ChangeLog b/frysk-core/frysk/value/ChangeLog
index da3361c..a1bc19a 100644
--- a/frysk-core/frysk/value/ChangeLog
+++ b/frysk-core/frysk/value/ChangeLog
@@ -1,3 +1,8 @@
+2007-11-29  Teresa Thomas  <tthomas@redhat.com>
+
+	* PointerType.java (toPrint): Catch exception
+	on memory error.
+
 2007-11-29  Sami Wagiaalla  <swagiaal@redhat.com>
 
 	Removed List ops from LocationExpression constructor.
@@ -18,7 +23,7 @@
 	* CompositeType.java (addStaticBitFieldMember): Renamed.
 	(addBitFieldMember): Renamed.
 	* TestComposite.java: Updated
-	
+
 2007-11-28  Teresa Thomas  <tthomas@redhat.com>
 
 	* PointerType.java (slice): Re-write.
diff --git a/frysk-core/frysk/value/PointerType.java b/frysk-core/frysk/value/PointerType.java
index d72c414..b6e2f27 100644
--- a/frysk-core/frysk/value/PointerType.java
+++ b/frysk-core/frysk/value/PointerType.java
@@ -82,18 +82,25 @@ public class PointerType
 	writer.print("(");
 	this.toPrint(writer, 0);
 	writer.print(") ");	
-	format.print(writer, location, this);
+	try {
+	   format.print(writer, location, this);
+	} catch (RuntimeException e) {
+	    throw new RuntimeException("Peek Memory");
+	}
 	if (type instanceof CharType) {
 	    // XXX: ByteBuffer.slice wants longs.
 	    long addr = getBigInteger(location).longValue();
-	    // Null pointer
-	    if (addr == 0)
-		return;
 	    writer.print(" \"");
 	    while (true) {
 		Location l = new ByteBufferLocation(memory, addr,
 						    type.getSize());
-		BigInteger c = ((CharType)type).getBigInteger(l);
+		BigInteger c = BigInteger.ZERO;
+		try {
+		   c = ((CharType)type).getBigInteger(l);
+		} catch (RuntimeException e) {
+		    writer.print(" < Memory Error > ");
+		    break;
+		}
 		if (c.equals(BigInteger.ZERO))
 		    break; // NUL
 		writer.print((char)c.longValue());


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


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

only message in thread, other threads:[~2007-11-29 18:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-29 18:08 [SCM] master: Catch exceptions on memory errors while printing pointers 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).