This is the mail archive of the gdb-patches@sources.redhat.com 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]

[PATCH]: ppcnbsd-nat.c, fp register access


I'll be checking in the enclosed patch shortly.  

The change I submitted to add support for floating point registers in
the NetBSD/powerpc port was slightly modified when it was integrated.
This resulted in an incompatibility between it and the code I added to
GDB at the same time.  Unfortunately, I haven't had time to update my
sources since then.

This patch makes no provisions for the old name of the field in the 
fpreg struct, since it never appeared in the NetBSD sources.  I think
I'm pretty much the only one it would effect.

Many thanks to Andrew Cagney who ran into the problem and brought it
to my attention.

        --jtc

2001-04-30  J.T. Conklin  <jtc@redback.com>

	* ppcnbsd-nat.c (fetch_inferior_registers)
 	(store_inferior_registers, fetch_core_registers): Changed to use
	fpreg[] instead of r_regs[] to access floating point registers.

Index: ppcnbsd-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/ppcnbsd-nat.c,v
retrieving revision 1.5
diff -c -r1.5 ppcnbsd-nat.c
*** ppcnbsd-nat.c	2001/03/06 08:21:11	1.5
--- ppcnbsd-nat.c	2001/04/30 23:47:53
***************
*** 59,65 ****
    ptrace (PT_GETFPREGS, inferior_pid,
  	  (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0);
    for (i = 0; i < 32; i++)
!     RF (FP0_REGNUM + i, inferior_fp_registers.r_regs[i]);
  #endif
  
    registers_fetched ();
--- 59,65 ----
    ptrace (PT_GETFPREGS, inferior_pid,
  	  (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0);
    for (i = 0; i < 32; i++)
!     RF (FP0_REGNUM + i, inferior_fp_registers.fpreg[i]);
  #endif
  
    registers_fetched ();
***************
*** 87,93 ****
  
  #ifdef PT_SETFPREGS
    for (i = 0; i < 32; i++)
!     RS (FP0_REGNUM + i, inferior_fp_registers.r_regs[i]);
    ptrace (PT_SETFPREGS, inferior_pid,
  	  (PTRACE_ARG3_TYPE) & inferior_fp_registers, 0);
  #endif
--- 87,93 ----
  
  #ifdef PT_SETFPREGS
    for (i = 0; i < 32; i++)
!     RS (FP0_REGNUM + i, inferior_fp_registers.fpreg[i]);
    ptrace (PT_SETFPREGS, inferior_pid,
  	  (PTRACE_ARG3_TYPE) & inferior_fp_registers, 0);
  #endif
***************
*** 120,126 ****
  #ifdef PT_FPGETREGS
    /* Floating point registers */
    for (i = 0; i < 32; i++)
!     RF (FP0_REGNUM + i, core_reg->freg.r_regs[i]);
  #endif
  
    registers_fetched ();
--- 120,126 ----
  #ifdef PT_FPGETREGS
    /* Floating point registers */
    for (i = 0; i < 32; i++)
!     RF (FP0_REGNUM + i, core_reg->freg.fpreg[i]);
  #endif
  
    registers_fetched ();


-- 
J.T. Conklin
RedBack Networks


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