Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: jose.marchesi@oracle.com (Jose E. Marchesi)
To: gdb-patches@sourceware.org
Subject: [PATCH][SPARC64] Fix invalid offsets to access fpregset_t
Date: Thu, 13 Feb 2014 16:34:00 -0000	[thread overview]
Message-ID: <874n439dgk.fsf@oracle.com> (raw)


Hi.

I noticed that the %fsr register is not being properly accessed from gdb
in sparc64.  This is because sparc64_supply_fpregset and
sparc64_collect_fpregset are using the offsets from the
sparc32_bsd_fpregset constant instead of sparc64_bsd_fpregset.

How to reproduce the problem: set %f32 to some value and see how $fsr is
modified as well.  Also, execute a FCMP* instruction (if (myfloat >
3.14)) and see how $fsr does not change to reflect the fp condition
codes.

I checked and the BSD sparc64 targets are using the proper offsets.
Ditto for the linux sparc32 target.

This little patch fixes this problem.  No noticeable regressions running
the test suite.

Ok to apply?


2014-02-13  Jose E. Marchesi  <jose.marchesi@oracle.com>

	* sparc64-linux-nat.c (_initialize_sparc64_linux_nat): Register
	the proper offsets to access fpregset_t.

diff --git a/gdb/sparc64-linux-nat.c b/gdb/sparc64-linux-nat.c
index a18da3a..80411dc 100644
--- a/gdb/sparc64-linux-nat.c
+++ b/gdb/sparc64-linux-nat.c
@@ -80,6 +80,8 @@ _initialize_sparc64_linux_nat (void)
   /* Fill in the generic GNU/Linux methods.  */
   t = linux_target ();
 
+  sparc_fpregset = &sparc64_bsd_fpregset;
+
   /* Add our register access methods.  */
   t->to_fetch_registers = sparc_fetch_inferior_registers;
   t->to_store_registers = sparc_store_inferior_registers;


             reply	other threads:[~2014-02-13 16:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-13 16:34 Jose E. Marchesi [this message]
2014-02-13 19:42 ` Mark Kettenis

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=874n439dgk.fsf@oracle.com \
    --to=jose.marchesi@oracle.com \
    --cc=gdb-patches@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