Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* RFA: don't assume gprs, fprs, some SPRS are contiguous
@ 2004-05-04  1:14 Jim Blandy
  2004-05-04 16:06 ` Kevin Buettner
  0 siblings, 1 reply; 5+ messages in thread
From: Jim Blandy @ 2004-05-04  1:14 UTC (permalink / raw)
  To: gdb-patches


Here's a revision of a patch I posted previously, in light of the
other patches I've posted today.

2004-04-20  Jim Blandy  <jimb@redhat.com>

	* ppc-linux-nat.c (fetch_ppc_registers, store_ppc_registers):
	Don't assume that the gprs, fprs, and UISA sprs are
	contiguous, start at register number zero, and end with fpscr.
	Instead, use the numbers from the tdep structure, FP0_REGNUM,
	and FPLAST_REGNUM.

*** gdb/ppc-linux-nat.c	2004-05-03 18:50:56.000000000 -0500
--- gdb/ppc-linux-nat.c	2004-05-03 19:00:50.000000000 -0500
***************
*** 311,320 ****
    int i;
    struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
  
!   for (i = 0; i <= tdep->ppc_fpscr_regnum; i++)
!     fetch_register (tid, i);
    if (tdep->ppc_mq_regnum != -1)
      fetch_register (tid, tdep->ppc_mq_regnum);
    if (have_ptrace_getvrregs)
      if (tdep->ppc_vr0_regnum != -1 && tdep->ppc_vrsave_regnum != -1)
        fetch_altivec_registers (tid);
--- 311,336 ----
    int i;
    struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
  
!   for (i = 0; i < ppc_num_gprs; i++)
!     fetch_register (tid, tdep->ppc_gp0_regnum + i);
!   if (FP0_REGNUM >= 0)
!     for (i = 0; i < ppc_num_fprs; i++)
!       fetch_register (tid, FP0_REGNUM + i);
!   fetch_register (tid, PC_REGNUM);
!   if (tdep->ppc_ps_regnum != -1)
!     fetch_register (tid, tdep->ppc_ps_regnum);
!   if (tdep->ppc_cr_regnum != -1)
!     fetch_register (tid, tdep->ppc_cr_regnum);
!   if (tdep->ppc_lr_regnum != -1)
!     fetch_register (tid, tdep->ppc_lr_regnum);
!   if (tdep->ppc_ctr_regnum != -1)
!     fetch_register (tid, tdep->ppc_ctr_regnum);
!   if (tdep->ppc_xer_regnum != -1)
!     fetch_register (tid, tdep->ppc_xer_regnum);
    if (tdep->ppc_mq_regnum != -1)
      fetch_register (tid, tdep->ppc_mq_regnum);
+   if (tdep->ppc_fpscr_regnum != -1)
+     fetch_register (tid, tdep->ppc_fpscr_regnum);
    if (have_ptrace_getvrregs)
      if (tdep->ppc_vr0_regnum != -1 && tdep->ppc_vrsave_regnum != -1)
        fetch_altivec_registers (tid);
***************
*** 480,489 ****
    int i;
    struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
    
!   for (i = 0; i <= tdep->ppc_fpscr_regnum; i++)
!     store_register (tid, i);
    if (tdep->ppc_mq_regnum != -1)
      store_register (tid, tdep->ppc_mq_regnum);
    if (have_ptrace_getvrregs)
      if (tdep->ppc_vr0_regnum != -1 && tdep->ppc_vrsave_regnum != -1)
        store_altivec_registers (tid);
--- 496,521 ----
    int i;
    struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
    
!   for (i = 0; i < ppc_num_gprs; i++)
!     store_register (tid, tdep->ppc_gp0_regnum + i);
!   if (FP0_REGNUM >= 0)
!     for (i = 0; i < ppc_num_fprs; i++)
!       store_register (tid, FP0_REGNUM + i);
!   store_register (tid, PC_REGNUM);
!   if (tdep->ppc_ps_regnum != -1)
!     store_register (tid, tdep->ppc_ps_regnum);
!   if (tdep->ppc_cr_regnum != -1)
!     store_register (tid, tdep->ppc_cr_regnum);
!   if (tdep->ppc_lr_regnum != -1)
!     store_register (tid, tdep->ppc_lr_regnum);
!   if (tdep->ppc_ctr_regnum != -1)
!     store_register (tid, tdep->ppc_ctr_regnum);
!   if (tdep->ppc_xer_regnum != -1)
!     store_register (tid, tdep->ppc_xer_regnum);
    if (tdep->ppc_mq_regnum != -1)
      store_register (tid, tdep->ppc_mq_regnum);
+   if (tdep->ppc_fpscr_regnum != -1)
+     store_register (tid, tdep->ppc_fpscr_regnum);
    if (have_ptrace_getvrregs)
      if (tdep->ppc_vr0_regnum != -1 && tdep->ppc_vrsave_regnum != -1)
        store_altivec_registers (tid);


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

* Re: RFA: don't assume gprs, fprs, some SPRS are contiguous
  2004-05-04  1:14 RFA: don't assume gprs, fprs, some SPRS are contiguous Jim Blandy
@ 2004-05-04 16:06 ` Kevin Buettner
  2004-05-04 21:30   ` Jim Blandy
  0 siblings, 1 reply; 5+ messages in thread
From: Kevin Buettner @ 2004-05-04 16:06 UTC (permalink / raw)
  To: Jim Blandy; +Cc: gdb-patches

On 03 May 2004 20:09:31 -0500
Jim Blandy <jimb@redhat.com> wrote:

> Here's a revision of a patch I posted previously, in light of the
> other patches I've posted today.
> 
> 2004-04-20  Jim Blandy  <jimb@redhat.com>
> 
> 	* ppc-linux-nat.c (fetch_ppc_registers, store_ppc_registers):
> 	Don't assume that the gprs, fprs, and UISA sprs are
> 	contiguous, start at register number zero, and end with fpscr.
> 	Instead, use the numbers from the tdep structure, FP0_REGNUM,
> 	and FPLAST_REGNUM.

The FPLAST_REGNUM portion of the ChangeLog entry doesn't make sense anymore.

Otherwise it looks okay provided the
s/FP0_REGNUM/tdep->ppc_fp0_regnum/ change is made.

Kevin


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

* Re: RFA: don't assume gprs, fprs, some SPRS are contiguous
  2004-05-04 16:06 ` Kevin Buettner
@ 2004-05-04 21:30   ` Jim Blandy
  2004-05-04 22:06     ` Kevin Buettner
  0 siblings, 1 reply; 5+ messages in thread
From: Jim Blandy @ 2004-05-04 21:30 UTC (permalink / raw)
  To: Kevin Buettner; +Cc: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 828 bytes --]

Kevin Buettner <kevinb@redhat.com> writes:

> On 03 May 2004 20:09:31 -0500
> Jim Blandy <jimb@redhat.com> wrote:
> 
> > Here's a revision of a patch I posted previously, in light of the
> > other patches I've posted today.
> > 
> > 2004-04-20  Jim Blandy  <jimb@redhat.com>
> > 
> > 	* ppc-linux-nat.c (fetch_ppc_registers, store_ppc_registers):
> > 	Don't assume that the gprs, fprs, and UISA sprs are
> > 	contiguous, start at register number zero, and end with fpscr.
> > 	Instead, use the numbers from the tdep structure, FP0_REGNUM,
> > 	and FPLAST_REGNUM.
> 
> The FPLAST_REGNUM portion of the ChangeLog entry doesn't make sense anymore.
> 
> Otherwise it looks okay provided the
> s/FP0_REGNUM/tdep->ppc_fp0_regnum/ change is made.

Here's the revised patch; I'll commit after the FP0_REGNUM elimination
patch is done.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: remove assumption that gprs, fprs, and uisa sprs are contiguous --]
[-- Type: text/x-patch, Size: 3425 bytes --]

2004-04-20  Jim Blandy  <jimb@redhat.com>

	* ppc-linux-nat.c (fetch_ppc_registers, store_ppc_registers):
	Don't assume that the gprs, fprs, and UISA sprs are
	contiguous, start at register number zero, and end with fpscr.
	Instead, use the numbers from the tdep structure.

*** gdb/ppc-linux-nat.c	2004-05-04 13:32:34.000000000 -0500
--- gdb/ppc-linux-nat.c	2004-05-04 15:46:55.000000000 -0500
***************
*** 314,323 ****
    int i;
    struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
  
!   for (i = 0; i <= tdep->ppc_fpscr_regnum; i++)
!     fetch_register (tid, i);
    if (tdep->ppc_mq_regnum != -1)
      fetch_register (tid, tdep->ppc_mq_regnum);
    if (have_ptrace_getvrregs)
      if (tdep->ppc_vr0_regnum != -1 && tdep->ppc_vrsave_regnum != -1)
        fetch_altivec_registers (tid);
--- 314,339 ----
    int i;
    struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
  
!   for (i = 0; i < ppc_num_gprs; i++)
!     fetch_register (tid, tdep->ppc_gp0_regnum + i);
!   if (tdep->ppc_fp0_regnum >= 0)
!     for (i = 0; i < ppc_num_fprs; i++)
!       fetch_register (tid, tdep->ppc_fp0_regnum + i);
!   fetch_register (tid, PC_REGNUM);
!   if (tdep->ppc_ps_regnum != -1)
!     fetch_register (tid, tdep->ppc_ps_regnum);
!   if (tdep->ppc_cr_regnum != -1)
!     fetch_register (tid, tdep->ppc_cr_regnum);
!   if (tdep->ppc_lr_regnum != -1)
!     fetch_register (tid, tdep->ppc_lr_regnum);
!   if (tdep->ppc_ctr_regnum != -1)
!     fetch_register (tid, tdep->ppc_ctr_regnum);
!   if (tdep->ppc_xer_regnum != -1)
!     fetch_register (tid, tdep->ppc_xer_regnum);
    if (tdep->ppc_mq_regnum != -1)
      fetch_register (tid, tdep->ppc_mq_regnum);
+   if (tdep->ppc_fpscr_regnum != -1)
+     fetch_register (tid, tdep->ppc_fpscr_regnum);
    if (have_ptrace_getvrregs)
      if (tdep->ppc_vr0_regnum != -1 && tdep->ppc_vrsave_regnum != -1)
        fetch_altivec_registers (tid);
***************
*** 485,494 ****
    int i;
    struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
    
!   for (i = 0; i <= tdep->ppc_fpscr_regnum; i++)
!     store_register (tid, i);
    if (tdep->ppc_mq_regnum != -1)
      store_register (tid, tdep->ppc_mq_regnum);
    if (have_ptrace_getvrregs)
      if (tdep->ppc_vr0_regnum != -1 && tdep->ppc_vrsave_regnum != -1)
        store_altivec_registers (tid);
--- 501,526 ----
    int i;
    struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
    
!   for (i = 0; i < ppc_num_gprs; i++)
!     store_register (tid, tdep->ppc_gp0_regnum + i);
!   if (tdep->ppc_fp0_regnum >= 0)
!     for (i = 0; i < ppc_num_fprs; i++)
!       store_register (tid, tdep->ppc_fp0_regnum + i);
!   store_register (tid, PC_REGNUM);
!   if (tdep->ppc_ps_regnum != -1)
!     store_register (tid, tdep->ppc_ps_regnum);
!   if (tdep->ppc_cr_regnum != -1)
!     store_register (tid, tdep->ppc_cr_regnum);
!   if (tdep->ppc_lr_regnum != -1)
!     store_register (tid, tdep->ppc_lr_regnum);
!   if (tdep->ppc_ctr_regnum != -1)
!     store_register (tid, tdep->ppc_ctr_regnum);
!   if (tdep->ppc_xer_regnum != -1)
!     store_register (tid, tdep->ppc_xer_regnum);
    if (tdep->ppc_mq_regnum != -1)
      store_register (tid, tdep->ppc_mq_regnum);
+   if (tdep->ppc_fpscr_regnum != -1)
+     store_register (tid, tdep->ppc_fpscr_regnum);
    if (have_ptrace_getvrregs)
      if (tdep->ppc_vr0_regnum != -1 && tdep->ppc_vrsave_regnum != -1)
        store_altivec_registers (tid);

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

* Re: RFA: don't assume gprs, fprs, some SPRS are contiguous
  2004-05-04 21:30   ` Jim Blandy
@ 2004-05-04 22:06     ` Kevin Buettner
  2004-05-05  1:48       ` Jim Blandy
  0 siblings, 1 reply; 5+ messages in thread
From: Kevin Buettner @ 2004-05-04 22:06 UTC (permalink / raw)
  To: Jim Blandy; +Cc: gdb-patches

On 04 May 2004 16:25:58 -0500
Jim Blandy <jimb@redhat.com> wrote:

> Here's the revised patch; I'll commit after the FP0_REGNUM elimination
> patch is done.

I've proofread the revised patch.  I didn't see any problems.

Kevin


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

* Re: RFA: don't assume gprs, fprs, some SPRS are contiguous
  2004-05-04 22:06     ` Kevin Buettner
@ 2004-05-05  1:48       ` Jim Blandy
  0 siblings, 0 replies; 5+ messages in thread
From: Jim Blandy @ 2004-05-05  1:48 UTC (permalink / raw)
  To: Kevin Buettner; +Cc: gdb-patches

Kevin Buettner <kevinb@redhat.com> writes:

> On 04 May 2004 16:25:58 -0500
> Jim Blandy <jimb@redhat.com> wrote:
> 
> > Here's the revised patch; I'll commit after the FP0_REGNUM elimination
> > patch is done.
> 
> I've proofread the revised patch.  I didn't see any problems.

Thanks, committed.


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

end of thread, other threads:[~2004-05-05  1:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-04  1:14 RFA: don't assume gprs, fprs, some SPRS are contiguous Jim Blandy
2004-05-04 16:06 ` Kevin Buettner
2004-05-04 21:30   ` Jim Blandy
2004-05-04 22:06     ` Kevin Buettner
2004-05-05  1:48       ` Jim Blandy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox