public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH][SPARC64] Fix invalid offsets to access fpregset_t
@ 2014-02-13 16:34 Jose E. Marchesi
  2014-02-13 19:42 ` Mark Kettenis
  0 siblings, 1 reply; 3+ messages in thread
From: Jose E. Marchesi @ 2014-02-13 16:34 UTC (permalink / raw)
  To: gdb-patches


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;

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

* Re: [PATCH][SPARC64] Fix invalid offsets to access fpregset_t
  2014-02-13 16:34 [PATCH][SPARC64] Fix invalid offsets to access fpregset_t Jose E. Marchesi
@ 2014-02-13 19:42 ` Mark Kettenis
  2014-02-14 10:53   ` Jose E. Marchesi
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Kettenis @ 2014-02-13 19:42 UTC (permalink / raw)
  To: jose.marchesi; +Cc: gdb-patches

> 
> 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?

Sure!

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

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

* Re: [PATCH][SPARC64] Fix invalid offsets to access fpregset_t
  2014-02-13 19:42 ` Mark Kettenis
@ 2014-02-14 10:53   ` Jose E. Marchesi
  0 siblings, 0 replies; 3+ messages in thread
From: Jose E. Marchesi @ 2014-02-14 10:53 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: gdb-patches


    > 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?
    
    Sure!
    
    > 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.
    > 

Thanks.  Committed.

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

end of thread, other threads:[~2014-02-14 10:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-13 16:34 [PATCH][SPARC64] Fix invalid offsets to access fpregset_t Jose E. Marchesi
2014-02-13 19:42 ` Mark Kettenis
2014-02-14 10:53   ` Jose E. Marchesi

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