This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH][SPARC64] Fix invalid offsets to access fpregset_t


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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]