public inbox for frysk@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: frysk@sourceware.org
Cc: Nurdin Premji <npremji@redhat.com>, Stan Cox <scox@redhat.com>
Subject: Re: frysk-core/frysk gui/ChangeLog stack/RemoteFra ...
Date: Wed, 15 Aug 2007 08:54:00 -0000	[thread overview]
Message-ID: <1187168080.3804.23.camel@dijkstra.wildebeest.org> (raw)
In-Reply-To: <20070813221141.30722.qmail@sourceware.org>

[-- Attachment #1: Type: text/plain, Size: 550 bytes --]

Hi,

On Mon, 2007-08-13 at 22:11 +0000, npremji@sourceware.org wrote:
> 	* RemoteFrame.java (getRegisterValue): Check for floating point registers.
> 	Don't throw a null pointer if register can't be located.

This is the patch that broke a couple of tests on x86_64. Reverting it
makes the tests in frysk.debuginfo.TestFrameDebugInfo and
frysk.rt.TestUpdatingDisplayValue that throw NullPointerExceptions PASS
again.

I suspect that the test for whether or not this is a floating point
register fails on x86_64. Could you take a look?

Thanks,

Mark

[-- Attachment #2: RemoteFrame-nullpointer.diff --]
[-- Type: text/x-patch, Size: 1649 bytes --]

Index: frysk-core/frysk/stack/RemoteFrame.java
===================================================================
RCS file: /cvs/frysk/frysk-core/frysk/stack/RemoteFrame.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- frysk-core/frysk/stack/RemoteFrame.java	1 Aug 2007 18:50:15 -0000	1.10
+++ frysk-core/frysk/stack/RemoteFrame.java	13 Aug 2007 22:11:41 -0000	1.11
@@ -54,6 +54,7 @@
 import frysk.symtab.Symbol;
 import frysk.symtab.SymbolFactory;
 
+import frysk.value.StandardTypes;
 import frysk.value.Value;
 
 class RemoteFrame extends Frame
@@ -144,15 +145,24 @@
   }
   
   public Value getRegisterValue(Register register) {
-	logger.log(Level.FINE, "{0}: getRegisterValue register: {1}",
+	logger.log(Level.FINE, "{0}: getRegisterValue register: {1}\n",
 		new Object[] { this, register });
 	Isa isa = task.getIsa();
 	byte[] word = new byte[register.type.getSize()];
 	RegisterMap map = UnwindRegisterMapFactory.getRegisterMap(isa);
 
-	if (cursor.getRegister(map.getRegisterNumber(register), word) < 0)
+	try {
+	    if (register.type == StandardTypes.getIntType(isa)) {
+		if (cursor.getRegister(map.getRegisterNumber(register), word) < 0)
+		    return null;
+	    } else {
+		if (cursor.getFPRegister(map.getRegisterNumber(register), word) < 0)
+		    return null;
+	    }
+	} catch (NullPointerException exception) {
+	    logger.log(Level.WARNING, "{0}: couldn't get register: {1}\n", new Object[] {this, register});
 	    return null;
-
+	}
 	ArrayByteBuffer buffer = new ArrayByteBuffer(word);
 	buffer.order(register.type.getEndian());
 	return new Value(register.type, register.name, buffer);

       reply	other threads:[~2007-08-15  8:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20070813221141.30722.qmail@sourceware.org>
2007-08-15  8:54 ` Mark Wielaard [this message]
2007-08-15 21:02   ` Stan Cox
2007-08-16 17:30   ` Sami Wagiaalla

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=1187168080.3804.23.camel@dijkstra.wildebeest.org \
    --to=mark@klomp.org \
    --cc=frysk@sourceware.org \
    --cc=npremji@redhat.com \
    --cc=scox@redhat.com \
    /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).