public inbox for frysk@sourceware.org
 help / color / mirror / Atom feed
* Re: frysk-core/frysk gui/ChangeLog stack/RemoteFra ...
       [not found] <20070813221141.30722.qmail@sourceware.org>
@ 2007-08-15  8:54 ` Mark Wielaard
  2007-08-15 21:02   ` Stan Cox
  2007-08-16 17:30   ` Sami Wagiaalla
  0 siblings, 2 replies; 3+ messages in thread
From: Mark Wielaard @ 2007-08-15  8:54 UTC (permalink / raw)
  To: frysk; +Cc: Nurdin Premji, Stan Cox

[-- 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);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: frysk-core/frysk gui/ChangeLog stack/RemoteFra ...
  2007-08-15  8:54 ` frysk-core/frysk gui/ChangeLog stack/RemoteFra Mark Wielaard
@ 2007-08-15 21:02   ` Stan Cox
  2007-08-16 17:30   ` Sami Wagiaalla
  1 sibling, 0 replies; 3+ messages in thread
From: Stan Cox @ 2007-08-15 21:02 UTC (permalink / raw)
  To: Mark Wielaard; +Cc: Frysk List

On Wed, 2007-08-15 at 10:54 +0200, Mark Wielaard wrote:
> Could you take a look?

Thanks for narrowing it down Mark.  Guess I'm next in line to look at
it.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: frysk-core/frysk gui/ChangeLog stack/RemoteFra ...
  2007-08-15  8:54 ` frysk-core/frysk gui/ChangeLog stack/RemoteFra Mark Wielaard
  2007-08-15 21:02   ` Stan Cox
@ 2007-08-16 17:30   ` Sami Wagiaalla
  1 sibling, 0 replies; 3+ messages in thread
From: Sami Wagiaalla @ 2007-08-16 17:30 UTC (permalink / raw)
  To: Mark Wielaard; +Cc: frysk, Nurdin Premji, Stan Cox

Mark Wielaard wrote:
> 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 just committed a fix for this. The problem was that the code only 
checked for IntType and assumed all else is FloatType. A check for 
LongType was missing.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-08-16 17:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20070813221141.30722.qmail@sourceware.org>
2007-08-15  8:54 ` frysk-core/frysk gui/ChangeLog stack/RemoteFra Mark Wielaard
2007-08-15 21:02   ` Stan Cox
2007-08-16 17:30   ` Sami Wagiaalla

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).