Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] ppc/rs6000: use gdbarch_ps_regnum
@ 2004-10-16  0:41 Michael Snyder
  2004-10-16  1:08 ` Joel Brobecker
  2004-10-16  6:18 ` Kevin Buettner
  0 siblings, 2 replies; 6+ messages in thread
From: Michael Snyder @ 2004-10-16  0:41 UTC (permalink / raw)
  To: gdb-patches, Kevin Buettner, Joel Brobecker, jimb

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

Hi guys,

I just happened to notice this.  Gdbarch implements PS_REGNUM,
so there's no reason to keep it privately in the tdep struct.

Tested on powerpc-eabi, but not on the native platforms.

Michael


[-- Attachment #2: ps_regnum --]
[-- Type: text/plain, Size: 16406 bytes --]

2004-10-15  Michael Snyder  <msnyder@redhat.com>

	* ppc-tdep.h (struct gdbarch_tdep): Remove ppc_ps_regnum.
	* rs6000-tdep.c (rs6000_gdbarch_init): Use set_gdbarch_ps_regnum
	instead of putting it in the tdep struct.
	* rs6000-nat.c: Use PS_REGNUM instead of the tdep.
	* ppc-linux-nat.c: Ditto.
	* ppc-linux-tdep.c: Ditto.
	* aix-thread.c: Ditto.

Index: ppc-tdep.h
===================================================================
RCS file: /cvs/src/src/gdb/ppc-tdep.h,v
retrieving revision 1.45
diff -p -r1.45 ppc-tdep.h
*** ppc-tdep.h	4 Aug 2004 17:17:55 -0000	1.45
--- ppc-tdep.h	16 Oct 2004 00:32:50 -0000
*************** struct gdbarch_tdep
*** 145,151 ****
      const struct reg *regs;    /* from current variant */
      int ppc_gp0_regnum;		/* GPR register 0 */
      int ppc_toc_regnum;		/* TOC register */
-     int ppc_ps_regnum;	        /* Processor (or machine) status (%msr) */
      int ppc_cr_regnum;		/* Condition register */
      int ppc_lr_regnum;		/* Link register */
      int ppc_ctr_regnum;		/* Count register */
--- 145,150 ----
Index: rs6000-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v
retrieving revision 1.230
diff -p -r1.230 rs6000-tdep.c
*** rs6000-tdep.c	13 Oct 2004 16:38:22 -0000	1.230
--- rs6000-tdep.c	16 Oct 2004 00:32:51 -0000
*************** init_sim_regno_table (struct gdbarch *ar
*** 241,247 ****
      set_sim_regno (sim_regno, tdep->ppc_fpscr_regnum, sim_ppc_fpscr_regnum);
  
    set_sim_regno (sim_regno, gdbarch_pc_regnum (arch), sim_ppc_pc_regnum);
!   set_sim_regno (sim_regno, tdep->ppc_ps_regnum, sim_ppc_ps_regnum);
    set_sim_regno (sim_regno, tdep->ppc_cr_regnum, sim_ppc_cr_regnum);
  
    /* Segment registers.  */
--- 241,247 ----
      set_sim_regno (sim_regno, tdep->ppc_fpscr_regnum, sim_ppc_fpscr_regnum);
  
    set_sim_regno (sim_regno, gdbarch_pc_regnum (arch), sim_ppc_pc_regnum);
!   set_sim_regno (sim_regno, gdbarch_ps_regnum (arch), sim_ppc_ps_regnum);
    set_sim_regno (sim_regno, tdep->ppc_cr_regnum, sim_ppc_cr_regnum);
  
    /* Segment registers.  */
*************** ppc_supply_gregset (const struct regset 
*** 355,362 ****
  
    if (regnum == -1 || regnum == PC_REGNUM)
      ppc_supply_reg (regcache, PC_REGNUM, gregs, offsets->pc_offset);
!   if (regnum == -1 || regnum == tdep->ppc_ps_regnum)
!     ppc_supply_reg (regcache, tdep->ppc_ps_regnum,
  		    gregs, offsets->ps_offset);
    if (regnum == -1 || regnum == tdep->ppc_cr_regnum)
      ppc_supply_reg (regcache, tdep->ppc_cr_regnum,
--- 355,362 ----
  
    if (regnum == -1 || regnum == PC_REGNUM)
      ppc_supply_reg (regcache, PC_REGNUM, gregs, offsets->pc_offset);
!   if (regnum == -1 || regnum == PS_REGNUM)
!     ppc_supply_reg (regcache, PS_REGNUM,
  		    gregs, offsets->ps_offset);
    if (regnum == -1 || regnum == tdep->ppc_cr_regnum)
      ppc_supply_reg (regcache, tdep->ppc_cr_regnum,
*************** ppc_collect_gregset (const struct regset
*** 431,438 ****
  
    if (regnum == -1 || regnum == PC_REGNUM)
      ppc_collect_reg (regcache, PC_REGNUM, gregs, offsets->pc_offset);
!   if (regnum == -1 || regnum == tdep->ppc_ps_regnum)
!     ppc_collect_reg (regcache, tdep->ppc_ps_regnum,
  		     gregs, offsets->ps_offset);
    if (regnum == -1 || regnum == tdep->ppc_cr_regnum)
      ppc_collect_reg (regcache, tdep->ppc_cr_regnum,
--- 431,438 ----
  
    if (regnum == -1 || regnum == PC_REGNUM)
      ppc_collect_reg (regcache, PC_REGNUM, gregs, offsets->pc_offset);
!   if (regnum == -1 || regnum == PS_REGNUM)
!     ppc_collect_reg (regcache, PS_REGNUM,
  		     gregs, offsets->ps_offset);
    if (regnum == -1 || regnum == tdep->ppc_cr_regnum)
      ppc_collect_reg (regcache, tdep->ppc_cr_regnum,
*************** rs6000_gdbarch_init (struct gdbarch_info
*** 3099,3105 ****
  
    tdep->ppc_gp0_regnum = 0;
    tdep->ppc_toc_regnum = 2;
!   tdep->ppc_ps_regnum = 65;
    tdep->ppc_cr_regnum = 66;
    tdep->ppc_lr_regnum = 67;
    tdep->ppc_ctr_regnum = 68;
--- 3099,3105 ----
  
    tdep->ppc_gp0_regnum = 0;
    tdep->ppc_toc_regnum = 2;
!   set_gdbarch_ps_regnum (gdbarch, 65);
    tdep->ppc_cr_regnum = 66;
    tdep->ppc_lr_regnum = 67;
    tdep->ppc_ctr_regnum = 68;
Index: rs6000-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/rs6000-nat.c,v
retrieving revision 1.54
diff -p -r1.54 rs6000-nat.c
*** rs6000-nat.c	5 Oct 2004 21:53:33 -0000	1.54
--- rs6000-nat.c	16 Oct 2004 00:32:51 -0000
*************** regmap (int regno, int *isfloat)
*** 167,173 ****
      }
    else if (regno == PC_REGNUM)
      return IAR;
!   else if (regno == tdep->ppc_ps_regnum)
      return MSR;
    else if (regno == tdep->ppc_cr_regnum)
      return CR;
--- 167,173 ----
      }
    else if (regno == PC_REGNUM)
      return IAR;
!   else if (regno == PS_REGNUM)
      return MSR;
    else if (regno == tdep->ppc_cr_regnum)
      return CR;
*************** fetch_inferior_registers (int regno)
*** 366,372 ****
  
        /* Read special registers.  */
        fetch_register (PC_REGNUM);
!       fetch_register (tdep->ppc_ps_regnum);
        fetch_register (tdep->ppc_cr_regnum);
        fetch_register (tdep->ppc_lr_regnum);
        fetch_register (tdep->ppc_ctr_regnum);
--- 366,372 ----
  
        /* Read special registers.  */
        fetch_register (PC_REGNUM);
!       fetch_register (PS_REGNUM);
        fetch_register (tdep->ppc_cr_regnum);
        fetch_register (tdep->ppc_lr_regnum);
        fetch_register (tdep->ppc_ctr_regnum);
*************** store_inferior_registers (int regno)
*** 407,413 ****
  
        /* Write special registers.  */
        store_register (PC_REGNUM);
!       store_register (tdep->ppc_ps_regnum);
        store_register (tdep->ppc_cr_regnum);
        store_register (tdep->ppc_lr_regnum);
        store_register (tdep->ppc_ctr_regnum);
--- 407,413 ----
  
        /* Write special registers.  */
        store_register (PC_REGNUM);
!       store_register (PS_REGNUM);
        store_register (tdep->ppc_cr_regnum);
        store_register (tdep->ppc_lr_regnum);
        store_register (tdep->ppc_ctr_regnum);
*************** fetch_core_registers (char *core_reg_sec
*** 596,602 ****
  
        regcache_raw_supply (current_regcache, PC_REGNUM,
  			   (char *) &regs->r64.iar);
!       regcache_raw_supply (current_regcache, tdep->ppc_ps_regnum,
  			   (char *) &regs->r64.msr);
        regcache_raw_supply (current_regcache, tdep->ppc_cr_regnum,
  			   (char *) &regs->r64.cr);
--- 596,602 ----
  
        regcache_raw_supply (current_regcache, PC_REGNUM,
  			   (char *) &regs->r64.iar);
!       regcache_raw_supply (current_regcache, PS_REGNUM,
  			   (char *) &regs->r64.msr);
        regcache_raw_supply (current_regcache, tdep->ppc_cr_regnum,
  			   (char *) &regs->r64.cr);
*************** fetch_core_registers (char *core_reg_sec
*** 623,629 ****
  
        regcache_raw_supply (current_regcache, PC_REGNUM,
  			   (char *) &regs->r32.iar);
!       regcache_raw_supply (current_regcache, tdep->ppc_ps_regnum,
  			   (char *) &regs->r32.msr);
        regcache_raw_supply (current_regcache, tdep->ppc_cr_regnum,
  			   (char *) &regs->r32.cr);
--- 623,629 ----
  
        regcache_raw_supply (current_regcache, PC_REGNUM,
  			   (char *) &regs->r32.iar);
!       regcache_raw_supply (current_regcache, PS_REGNUM,
  			   (char *) &regs->r32.msr);
        regcache_raw_supply (current_regcache, tdep->ppc_cr_regnum,
  			   (char *) &regs->r32.cr);
Index: ppc-linux-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/ppc-linux-nat.c,v
retrieving revision 1.52
diff -p -r1.52 ppc-linux-nat.c
*** ppc-linux-nat.c	4 Aug 2004 17:45:30 -0000	1.52
--- ppc-linux-nat.c	16 Oct 2004 00:32:52 -0000
*************** ppc_register_u_addr (int regno)
*** 208,214 ****
    if (regno == tdep->ppc_mq_regnum)
      u_addr = PT_MQ * wordsize;
  #endif
!   if (regno == tdep->ppc_ps_regnum)
      u_addr = PT_MSR * wordsize;
    if (tdep->ppc_fpscr_regnum >= 0
        && regno == tdep->ppc_fpscr_regnum)
--- 208,214 ----
    if (regno == tdep->ppc_mq_regnum)
      u_addr = PT_MQ * wordsize;
  #endif
!   if (regno == PS_REGNUM)
      u_addr = PT_MSR * wordsize;
    if (tdep->ppc_fpscr_regnum >= 0
        && regno == tdep->ppc_fpscr_regnum)
*************** fetch_ppc_registers (int tid)
*** 459,466 ****
      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)
--- 459,466 ----
      for (i = 0; i < ppc_num_fprs; i++)
        fetch_register (tid, tdep->ppc_fp0_regnum + i);
    fetch_register (tid, PC_REGNUM);
!   if (PS_REGNUM != -1)
!     fetch_register (tid, PS_REGNUM);
    if (tdep->ppc_cr_regnum != -1)
      fetch_register (tid, tdep->ppc_cr_regnum);
    if (tdep->ppc_lr_regnum != -1)
*************** store_ppc_registers (int tid)
*** 743,750 ****
      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)
--- 743,750 ----
      for (i = 0; i < ppc_num_fprs; i++)
        store_register (tid, tdep->ppc_fp0_regnum + i);
    store_register (tid, PC_REGNUM);
!   if (PS_REGNUM != -1)
!     store_register (tid, PS_REGNUM);
    if (tdep->ppc_cr_regnum != -1)
      store_register (tid, tdep->ppc_cr_regnum);
    if (tdep->ppc_lr_regnum != -1)
*************** fill_gregset (gdb_gregset_t *gregsetp, i
*** 838,845 ****
        && (tdep->ppc_mq_regnum != -1))
      right_fill_reg (tdep->ppc_mq_regnum, regp + PT_MQ);
  #endif
!   if ((regno == -1) || regno == tdep->ppc_ps_regnum)
!     right_fill_reg (tdep->ppc_ps_regnum, regp + PT_MSR);
  }
  
  void
--- 838,845 ----
        && (tdep->ppc_mq_regnum != -1))
      right_fill_reg (tdep->ppc_mq_regnum, regp + PT_MQ);
  #endif
!   if ((regno == -1) || regno == PS_REGNUM)
!     right_fill_reg (PS_REGNUM, regp + PT_MSR);
  }
  
  void
Index: ppc-linux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ppc-linux-tdep.c,v
retrieving revision 1.66
diff -p -r1.66 ppc-linux-tdep.c
*** ppc-linux-tdep.c	31 Jul 2004 21:53:17 -0000	1.66
--- ppc-linux-tdep.c	16 Oct 2004 00:32:52 -0000
*************** ppc_linux_supply_gregset (struct regcach
*** 877,883 ****
    if (regcache_tdep->ppc_mq_regnum != -1)
      right_supply_register (regcache, wordsize, regcache_tdep->ppc_mq_regnum,
  			   buf + wordsize * PPC_LINUX_PT_MQ);
!   right_supply_register (regcache, wordsize, regcache_tdep->ppc_ps_regnum,
  			 buf + wordsize * PPC_LINUX_PT_MSR);
  }
  
--- 877,883 ----
    if (regcache_tdep->ppc_mq_regnum != -1)
      right_supply_register (regcache, wordsize, regcache_tdep->ppc_mq_regnum,
  			   buf + wordsize * PPC_LINUX_PT_MQ);
!   right_supply_register (regcache, wordsize, PS_REGNUM,
  			 buf + wordsize * PPC_LINUX_PT_MSR);
  }
  
Index: aix-thread.c
===================================================================
RCS file: /cvs/src/src/gdb/aix-thread.c,v
retrieving revision 1.37
diff -p -r1.37 aix-thread.c
*** aix-thread.c	8 Oct 2004 20:29:45 -0000	1.37
--- aix-thread.c	16 Oct 2004 00:32:52 -0000
*************** special_register_p (int regno)
*** 1060,1066 ****
    struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
  
    return regno == PC_REGNUM
!       || regno == tdep->ppc_ps_regnum
        || regno == tdep->ppc_cr_regnum
        || regno == tdep->ppc_lr_regnum
        || regno == tdep->ppc_ctr_regnum
--- 1060,1066 ----
    struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
  
    return regno == PC_REGNUM
!       || regno == PS_REGNUM
        || regno == tdep->ppc_cr_regnum
        || regno == tdep->ppc_lr_regnum
        || regno == tdep->ppc_ctr_regnum
*************** supply_sprs64 (uint64_t iar, uint64_t ms
*** 1081,1087 ****
    struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
  
    regcache_raw_supply (current_regcache, PC_REGNUM, (char *) &iar);
!   regcache_raw_supply (current_regcache, tdep->ppc_ps_regnum, (char *) &msr);
    regcache_raw_supply (current_regcache, tdep->ppc_cr_regnum, (char *) &cr);
    regcache_raw_supply (current_regcache, tdep->ppc_lr_regnum, (char *) &lr);
    regcache_raw_supply (current_regcache, tdep->ppc_ctr_regnum, (char *) &ctr);
--- 1081,1087 ----
    struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
  
    regcache_raw_supply (current_regcache, PC_REGNUM, (char *) &iar);
!   regcache_raw_supply (current_regcache, PS_REGNUM, (char *) &msr);
    regcache_raw_supply (current_regcache, tdep->ppc_cr_regnum, (char *) &cr);
    regcache_raw_supply (current_regcache, tdep->ppc_lr_regnum, (char *) &lr);
    regcache_raw_supply (current_regcache, tdep->ppc_ctr_regnum, (char *) &ctr);
*************** supply_sprs32 (uint32_t iar, uint32_t ms
*** 1102,1108 ****
    struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
  
    regcache_raw_supply (current_regcache, PC_REGNUM, (char *) &iar);
!   regcache_raw_supply (current_regcache, tdep->ppc_ps_regnum, (char *) &msr);
    regcache_raw_supply (current_regcache, tdep->ppc_cr_regnum, (char *) &cr);
    regcache_raw_supply (current_regcache, tdep->ppc_lr_regnum, (char *) &lr);
    regcache_raw_supply (current_regcache, tdep->ppc_ctr_regnum, (char *) &ctr);
--- 1102,1108 ----
    struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
  
    regcache_raw_supply (current_regcache, PC_REGNUM, (char *) &iar);
!   regcache_raw_supply (current_regcache, PS_REGNUM, (char *) &msr);
    regcache_raw_supply (current_regcache, tdep->ppc_cr_regnum, (char *) &cr);
    regcache_raw_supply (current_regcache, tdep->ppc_lr_regnum, (char *) &lr);
    regcache_raw_supply (current_regcache, tdep->ppc_ctr_regnum, (char *) &ctr);
*************** fill_sprs64 (uint64_t *iar, uint64_t *ms
*** 1337,1344 ****
  
    if (register_cached (PC_REGNUM))
      regcache_raw_collect (current_regcache, PC_REGNUM, iar);
!   if (register_cached (tdep->ppc_ps_regnum))
!     regcache_raw_collect (current_regcache, tdep->ppc_ps_regnum, msr);
    if (register_cached (tdep->ppc_cr_regnum))
      regcache_raw_collect (current_regcache, tdep->ppc_cr_regnum, cr);
    if (register_cached (tdep->ppc_lr_regnum))
--- 1337,1344 ----
  
    if (register_cached (PC_REGNUM))
      regcache_raw_collect (current_regcache, PC_REGNUM, iar);
!   if (register_cached (PS_REGNUM))
!     regcache_raw_collect (current_regcache, PS_REGNUM, msr);
    if (register_cached (tdep->ppc_cr_regnum))
      regcache_raw_collect (current_regcache, tdep->ppc_cr_regnum, cr);
    if (register_cached (tdep->ppc_lr_regnum))
*************** fill_sprs32 (unsigned long *iar, unsigne
*** 1373,1380 ****
  
    if (register_cached (PC_REGNUM))
      regcache_raw_collect (current_regcache, PC_REGNUM, iar);
!   if (register_cached (tdep->ppc_ps_regnum))
!     regcache_raw_collect (current_regcache, tdep->ppc_ps_regnum, msr);
    if (register_cached (tdep->ppc_cr_regnum))
      regcache_raw_collect (current_regcache, tdep->ppc_cr_regnum, cr);
    if (register_cached (tdep->ppc_lr_regnum))
--- 1373,1380 ----
  
    if (register_cached (PC_REGNUM))
      regcache_raw_collect (current_regcache, PC_REGNUM, iar);
!   if (register_cached (PS_REGNUM))
!     regcache_raw_collect (current_regcache, PS_REGNUM, msr);
    if (register_cached (tdep->ppc_cr_regnum))
      regcache_raw_collect (current_regcache, tdep->ppc_cr_regnum, cr);
    if (register_cached (tdep->ppc_lr_regnum))
*************** store_regs_user_thread (pthdb_pthread_t 
*** 1457,1463 ****
                     &tmp_fpscr);
        if (register_cached (PC_REGNUM))
  	ctx.iar = tmp_iar;
!       if (register_cached (tdep->ppc_ps_regnum))
  	ctx.msr = tmp_msr;
        if (register_cached (tdep->ppc_cr_regnum))
  	ctx.cr  = tmp_cr;
--- 1457,1463 ----
                     &tmp_fpscr);
        if (register_cached (PC_REGNUM))
  	ctx.iar = tmp_iar;
!       if (register_cached (PS_REGNUM))
  	ctx.msr = tmp_msr;
        if (register_cached (tdep->ppc_cr_regnum))
  	ctx.cr  = tmp_cr;

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

* Re: [RFA] ppc/rs6000: use gdbarch_ps_regnum
  2004-10-16  0:41 [RFA] ppc/rs6000: use gdbarch_ps_regnum Michael Snyder
@ 2004-10-16  1:08 ` Joel Brobecker
  2004-10-16  3:23   ` Joel Brobecker
  2004-10-16  6:18 ` Kevin Buettner
  1 sibling, 1 reply; 6+ messages in thread
From: Joel Brobecker @ 2004-10-16  1:08 UTC (permalink / raw)
  To: Michael Snyder; +Cc: gdb-patches, Kevin Buettner, jimb

> I just happened to notice this.  Gdbarch implements PS_REGNUM,
> so there's no reason to keep it privately in the tdep struct.

> 2004-10-15  Michael Snyder  <msnyder@redhat.com>
> 
> 	* ppc-tdep.h (struct gdbarch_tdep): Remove ppc_ps_regnum.
> 	* rs6000-tdep.c (rs6000_gdbarch_init): Use set_gdbarch_ps_regnum
> 	instead of putting it in the tdep struct.
> 	* rs6000-nat.c: Use PS_REGNUM instead of the tdep.
> 	* ppc-linux-nat.c: Ditto.
> 	* ppc-linux-tdep.c: Ditto.
> 	* aix-thread.c: Ditto.

Seems good to me (pretty obvious actually), but I'd prefer it if Kevin
approved it too. Give him a week, and then check it in.

Currently testing on AIX 5.1 right now. Will send the results as soon
as they are available.

One tiny remark:

> *************** rs6000_gdbarch_init (struct gdbarch_info
> *** 3099,3105 ****
>   
>     tdep->ppc_gp0_regnum = 0;
>     tdep->ppc_toc_regnum = 2;
> !   tdep->ppc_ps_regnum = 65;
>     tdep->ppc_cr_regnum = 66;
>     tdep->ppc_lr_regnum = 67;
>     tdep->ppc_ctr_regnum = 68;
> --- 3099,3105 ----
>   
>     tdep->ppc_gp0_regnum = 0;
>     tdep->ppc_toc_regnum = 2;
> !   set_gdbarch_ps_regnum (gdbarch, 65);
>     tdep->ppc_cr_regnum = 66;
>     tdep->ppc_lr_regnum = 67;
>     tdep->ppc_ctr_regnum = 68;

I would personally prefer the set_gdbarch_ps_regnum call to
be moved slightly higher, where we set pc_regnum et al. What
do you think?

-- 
Joel


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

* Re: [RFA] ppc/rs6000: use gdbarch_ps_regnum
  2004-10-16  1:08 ` Joel Brobecker
@ 2004-10-16  3:23   ` Joel Brobecker
  0 siblings, 0 replies; 6+ messages in thread
From: Joel Brobecker @ 2004-10-16  3:23 UTC (permalink / raw)
  To: Michael Snyder; +Cc: gdb-patches, Kevin Buettner, jimb

> > 2004-10-15  Michael Snyder  <msnyder@redhat.com>
> > 
> > 	* ppc-tdep.h (struct gdbarch_tdep): Remove ppc_ps_regnum.
> > 	* rs6000-tdep.c (rs6000_gdbarch_init): Use set_gdbarch_ps_regnum
> > 	instead of putting it in the tdep struct.
> > 	* rs6000-nat.c: Use PS_REGNUM instead of the tdep.
> > 	* ppc-linux-nat.c: Ditto.
> > 	* ppc-linux-tdep.c: Ditto.
> > 	* aix-thread.c: Ditto.
> 
> Seems good to me (pretty obvious actually), but I'd prefer it if Kevin
> approved it too. Give him a week, and then check it in.
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Ahem, big blush, it just occured to me that these files do not even
remotely fall under AIX maintainership. So please ignore my go ahead,
I was confused by being Cc'ed.

> Currently testing on AIX 5.1 right now. Will send the results as soon
> as they are available.

Results are good. No regression.

-- 
Joel


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

* Re: [RFA] ppc/rs6000: use gdbarch_ps_regnum
  2004-10-16  0:41 [RFA] ppc/rs6000: use gdbarch_ps_regnum Michael Snyder
  2004-10-16  1:08 ` Joel Brobecker
@ 2004-10-16  6:18 ` Kevin Buettner
  2004-10-18 20:32   ` Michael Snyder
  1 sibling, 1 reply; 6+ messages in thread
From: Kevin Buettner @ 2004-10-16  6:18 UTC (permalink / raw)
  To: Michael Snyder; +Cc: gdb-patches, Joel Brobecker, jimb

On Fri, 15 Oct 2004 17:41:10 -0700
Michael Snyder <msnyder@redhat.com> wrote:

> I just happened to notice this.  Gdbarch implements PS_REGNUM,
> so there's no reason to keep it privately in the tdep struct.

Is there some good reason to move it out of the private tdep
struct and into the public eye?

I'll note that ppc_fp0_regnum is also in the tdep struct, and
something comparable (FP0_REGNUM) is also in the gdbarch name space. 
Yet, rs6000-tdep does not set FP0_REGNUM via set_gdbarch_fp0_regnum()
and I happen to like it this way.  The reason is that there's no good
reason (that I know of) for the other parts of GDB to be aware of this
register numbering.  Also, putting the indexes into the tdep struct
gives a uniform mechanism of accessing (most of) the PPC related
register numbers.  If we were to move either the PS or FP0 register
number back out to gdbarch, then we'd be accessing some of the
registers via one mechanism and these others via another. 
(Unfortunately, we still have SP_REGNUM and PC_REGNUM in gdbarch land. 
But there are good reasons for other, non-ppc specific portions to
know about these register numbers.)

Kevin


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

* Re: [RFA] ppc/rs6000: use gdbarch_ps_regnum
  2004-10-16  6:18 ` Kevin Buettner
@ 2004-10-18 20:32   ` Michael Snyder
  2004-10-25 23:25     ` Andrew Cagney
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Snyder @ 2004-10-18 20:32 UTC (permalink / raw)
  To: Kevin Buettner; +Cc: gdb-patches, Joel Brobecker, jimb


> On Fri, 15 Oct 2004 17:41:10 -0700
> Michael Snyder <msnyder@redhat.com> wrote:
>
>> I just happened to notice this.  Gdbarch implements PS_REGNUM,
>> so there's no reason to keep it privately in the tdep struct.
>
> Is there some good reason to move it out of the private tdep
> struct and into the public eye?
>
> I'll note that ppc_fp0_regnum is also in the tdep struct, and
> something comparable (FP0_REGNUM) is also in the gdbarch name space.
> Yet, rs6000-tdep does not set FP0_REGNUM via set_gdbarch_fp0_regnum()
> and I happen to like it this way.  The reason is that there's no good
> reason (that I know of) for the other parts of GDB to be aware of this
> register numbering.  Also, putting the indexes into the tdep struct
> gives a uniform mechanism of accessing (most of) the PPC related
> register numbers.  If we were to move either the PS or FP0 register
> number back out to gdbarch, then we'd be accessing some of the
> registers via one mechanism and these others via another.
> (Unfortunately, we still have SP_REGNUM and PC_REGNUM in gdbarch land.
> But there are good reasons for other, non-ppc specific portions to
> know about these register numbers.)

No special reason -- I just figured that if there was a public interface,
there might be some motivation to use that instead of a private interface.

PS_REGNUM is referred to quite a lot -- but mostly in other tdep and nat
files that are orthogonal to this one.  The major exception being 
std-regs.c,
which sort-of groups PS in there with PC, SP and (cover your ears, Andrew)
FP.

I have no attachment to it, though, if you prefer it the way it is.



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

* Re: [RFA] ppc/rs6000: use gdbarch_ps_regnum
  2004-10-18 20:32   ` Michael Snyder
@ 2004-10-25 23:25     ` Andrew Cagney
  0 siblings, 0 replies; 6+ messages in thread
From: Andrew Cagney @ 2004-10-25 23:25 UTC (permalink / raw)
  To: Michael Snyder, Kevin Buettner; +Cc: gdb-patches, Joel Brobecker, jimb

Michael Snyder wrote:
> 
>> On Fri, 15 Oct 2004 17:41:10 -0700
>> Michael Snyder <msnyder@redhat.com> wrote:
>>
>>> I just happened to notice this.  Gdbarch implements PS_REGNUM,
>>> so there's no reason to keep it privately in the tdep struct.
>>
>>
>> Is there some good reason to move it out of the private tdep
>> struct and into the public eye?
>>
>> I'll note that ppc_fp0_regnum is also in the tdep struct, and
>> something comparable (FP0_REGNUM) is also in the gdbarch name space.
>> Yet, rs6000-tdep does not set FP0_REGNUM via set_gdbarch_fp0_regnum()
>> and I happen to like it this way.  The reason is that there's no good
>> reason (that I know of) for the other parts of GDB to be aware of this
>> register numbering.  Also, putting the indexes into the tdep struct
>> gives a uniform mechanism of accessing (most of) the PPC related
>> register numbers.  If we were to move either the PS or FP0 register
>> number back out to gdbarch, then we'd be accessing some of the
>> registers via one mechanism and these others via another.
>> (Unfortunately, we still have SP_REGNUM and PC_REGNUM in gdbarch land.
>> But there are good reasons for other, non-ppc specific portions to
>> know about these register numbers.)

Kevin's correct, and just like DEPRECATED_FP_REGNUM, SP_REGNUM, 
PC_REGNUM, and FP0_REGNUM are all on my hit list :-)

Andrew

> No special reason -- I just figured that if there was a public interface,
> there might be some motivation to use that instead of a private interface.
> 
> PS_REGNUM is referred to quite a lot -- but mostly in other tdep and nat
> files that are orthogonal to this one.  The major exception being 
> std-regs.c,
> which sort-of groups PS in there with PC, SP and (cover your ears, Andrew)
> FP.
> 
> I have no attachment to it, though, if you prefer it the way it is.
> 
> 


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

end of thread, other threads:[~2004-10-25 23:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-16  0:41 [RFA] ppc/rs6000: use gdbarch_ps_regnum Michael Snyder
2004-10-16  1:08 ` Joel Brobecker
2004-10-16  3:23   ` Joel Brobecker
2004-10-16  6:18 ` Kevin Buettner
2004-10-18 20:32   ` Michael Snyder
2004-10-25 23:25     ` Andrew Cagney

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