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]
Other format: [Raw text]

Re: RFA: RS6000: Use ppc_num_gprs and ppc_num_fprs whereappropriate


On 12 May 2004 20:12:18 -0500
Jim Blandy <jimb@redhat.com> wrote:

> 2004-05-12  Jim Blandy  <jimb@redhat.com>
> 
> 	* aix-thread.c (pdc_read_regs, supply_gprs64, supply_fprs)
> 	(fetch_regs_user_thread, fetch_regs_kernel_thread)
> 	(store_regs_user_thread, store_regs_kernel_thread): Use
> 	ppc_num_gprs and ppc_num_fprs instead of '32' and '31'.
> 	* ppc-linux-nat.c (fill_gregset): Same.
> 	* ppc-linux-tdep.c (ppc_linux_supply_gregset) 
> 	(ppc_linux_sigtramp_cache): Same.
> 	* ppcnbsd-tdep.c (ppcnbsd_supply_reg, ppcnbsd_fill_reg) 
> 	(ppcnbsd_sigtramp_cache_init): Same.
> 	* rs6000-nat.c (fetch_core_registers): Same.
> 	* rs6000-tdep.c (ppc_supply_gregset, ppc_collect_gregset) 
> 	(rs6000_frame_cache): Same.

Almost okay...

> *************** supply_fprs (double *vals)
> *** 1028,1034 ****
>        floating-point registers.  */
>     gdb_assert (ppc_floating_point_p (current_gdbarch));
>   
> !   for (regno = 0; regno < 32; regno++)
>       supply_register (regno + tdep->ppc_fp0_regnum, (char *) (vals + regno));
>   }
>   
> --- 1028,1034 ----
>        floating-point registers.  */
>     gdb_assert (ppc_floating_point_p (current_gdbarch));
>   
> !   for (regno = 0; regno < ppc_num_gprs; regno++)
>       supply_register (regno + tdep->ppc_fp0_regnum, (char *) (vals + regno));
>   }

I think ppc_num_fprs should be used here.

> *************** rs6000_frame_cache (struct frame_info *n
> *** 2491,2497 ****
>       {
>         int i;
>         CORE_ADDR gpr_addr = cache->base + fdata.gpr_offset;
> !       for (i = fdata.saved_gpr; i < 32; i++)
>   	{
>   	  cache->saved_regs[tdep->ppc_gp0_regnum + i].addr = gpr_addr;
>   	  gpr_addr += wordsize;
> --- 2491,2497 ----
>       {
>         int i;
>         CORE_ADDR gpr_addr = cache->base + fdata.gpr_offset;
> !       for (i = fdata.saved_gpr; i < ppc_num_fprs; i++)
>   	{
>   	  cache->saved_regs[tdep->ppc_gp0_regnum + i].addr = gpr_addr;
>   	  gpr_addr += wordsize;

I think this one should be using ppc_num_gprs.

A suitably revised patch is approved.

Kevin


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