public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
From: cagney@sourceware.org
To: frysk-cvs@sourceware.org
Subject: [SCM]  master: Fix libunwind's binding to use a buffer big enough to fit an FP reg.
Date: Mon, 10 Dec 2007 19:01:00 -0000	[thread overview]
Message-ID: <20071210190156.18748.qmail@sourceware.org> (raw)

The branch, master has been updated
       via  031d8a4db7053c83ff030b44732c545ac0fb4a7c (commit)
      from  30d73c0d378db568f8f3c3f0a8f0ec8c9d2650f1 (commit)

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

- Log -----------------------------------------------------------------
commit 031d8a4db7053c83ff030b44732c545ac0fb4a7c
Author: Andrew Cagney <cagney@toil.yyz.redhat.com>
Date:   Mon Dec 10 14:00:47 2007 -0500

    Fix libunwind's binding to use a buffer big enough to fit an FP reg.
    
    frysk-core/frysk/stack/ChangeLog
    2007-12-10  Andrew Cagney  <cagney@redhat.com>
    
    	* TestRegs.java (testFloatRegisters()): Enable on IA-32.
    	* LibunwindAddressSpace.java (accessReg(Number,byte[],boolean)):
    	Limit the transfer size to the register's size.
    
    frysk-sys/lib/unwind/ChangeLog
    2007-12-10  Andrew Cagney  <cagney@redhat.com>
    
    	* cni/UnwindH.hxx (access_fpreg): Allocate a buffer big enough for
    	unw_fpreg_t.

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

Summary of changes:
 frysk-core/frysk/stack/ChangeLog                  |    6 ++++++
 frysk-core/frysk/stack/LibunwindAddressSpace.java |   11 ++++++++++-
 frysk-core/frysk/stack/TestRegs.java              |    6 +++---
 frysk-sys/lib/unwind/ChangeLog                    |    5 +++++
 frysk-sys/lib/unwind/cni/UnwindH.hxx              |    2 +-
 5 files changed, 25 insertions(+), 5 deletions(-)

First 500 lines of diff:
diff --git a/frysk-core/frysk/stack/ChangeLog b/frysk-core/frysk/stack/ChangeLog
index 9656b93..cf5f5d6 100644
--- a/frysk-core/frysk/stack/ChangeLog
+++ b/frysk-core/frysk/stack/ChangeLog
@@ -1,3 +1,9 @@
+2007-12-10  Andrew Cagney  <cagney@redhat.com>
+
+	* TestRegs.java (testFloatRegisters()): Enable on IA-32.
+	* LibunwindAddressSpace.java (accessReg(Number,byte[],boolean)):
+	Limit the transfer size to the register's size.
+
 2007-12-03  Andrew Cagney  <cagney@redhat.com>
 
 	* LibunwindFrame.java: Revert <<Get CFA from cursor>>; add more
diff --git a/frysk-core/frysk/stack/LibunwindAddressSpace.java b/frysk-core/frysk/stack/LibunwindAddressSpace.java
index 5369fd5..ef2cf1e 100644
--- a/frysk-core/frysk/stack/LibunwindAddressSpace.java
+++ b/frysk-core/frysk/stack/LibunwindAddressSpace.java
@@ -104,7 +104,16 @@ class LibunwindAddressSpace extends AddressSpace {
 
     public int accessReg (Number regnum, byte[] fpvalp, boolean write) {
 	Register register = registerMap.getRegister(regnum);
-	task.access(register, 0, fpvalp.length, fpvalp, 0, write);
+	int length;
+	// Truncate transfer to size-of-register.
+	if (fpvalp.length > register.getType().getSize())
+	    length = register.getType().getSize();
+	else
+	    length = fpvalp.length;
+	logger.log(Level.FINE, "{0}: accessReg {1} ({2}), {3} bytes\n",
+		   new Object[] { this, regnum, register,
+				  new Integer(length) });
+	task.access(register, 0, length, fpvalp, 0, write);
 	return 0;
     }
 
diff --git a/frysk-core/frysk/stack/TestRegs.java b/frysk-core/frysk/stack/TestRegs.java
index c249801..3a00ffc 100644
--- a/frysk-core/frysk/stack/TestRegs.java
+++ b/frysk-core/frysk/stack/TestRegs.java
@@ -69,10 +69,10 @@ public class TestRegs extends RegsCase {
 
     // XXX: Delete this once the unresolved cases are fixed.
     public void testFloatRegisters() {
-	if (isa() == ISA.IA32 && unresolved(4911))
+// 	if (isa() == ISA.IA32 && unresolved(4911))
+// 	    return;
+	if (isa() == ISA.X8664 && unresolved(5195))
 	    return;
-        if (isa() == ISA.X8664 && unresolved(5195))
-            return;
 	super.testFloatRegisters();
     }
 
diff --git a/frysk-sys/lib/unwind/ChangeLog b/frysk-sys/lib/unwind/ChangeLog
index 8ade7ea..1078b4a 100644
--- a/frysk-sys/lib/unwind/ChangeLog
+++ b/frysk-sys/lib/unwind/ChangeLog
@@ -1,3 +1,8 @@
+2007-12-10  Andrew Cagney  <cagney@redhat.com>
+
+	* cni/UnwindH.hxx (access_fpreg): Allocate a buffer big enough for
+	unw_fpreg_t.
+
 2007-12-03  Mark Wielaard  <mwielaard@redhat.com>
 
 	* Cursor.java (getCFA): New method.
diff --git a/frysk-sys/lib/unwind/cni/UnwindH.hxx b/frysk-sys/lib/unwind/cni/UnwindH.hxx
index 4b59aa5..1d13156 100644
--- a/frysk-sys/lib/unwind/cni/UnwindH.hxx
+++ b/frysk-sys/lib/unwind/cni/UnwindH.hxx
@@ -167,7 +167,7 @@ static int
 access_fpreg(::unw_addr_space_t as, ::unw_regnum_t regnum,
 	     ::unw_fpreg_t *fpvalp, int write, void *arg)
 {
-  jbyteArray tmp = JvNewByteArray(sizeof (unw_word_t));
+  jbyteArray tmp = JvNewByteArray(sizeof (unw_fpreg_t));
   // Map the REGNUM back to the published ENUM.
   java::lang::Number* num = lib::unwind::TARGET_REGISTERS::valueOf(regnum);
   // Implement read/modify/write style op.


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


                 reply	other threads:[~2007-12-10 19:01 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=20071210190156.18748.qmail@sourceware.org \
    --to=cagney@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).