[rfc] [06/14] Prepare cris targets

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[rfc] [06/14] Prepare cris targets

Ulrich Weigand

this patch prepares the cris targets by adding REGCACHE arguments to
internal helper routines.

Also, the cris-tdep.c supply_gregset routine is not really an
instance of the global supply_gregset interface, it is just a
static routine.  To reduce confusion, I've renamed it to carry
a cris_ prefix.



        * cris-tdep.c (supply_gregset): Rename to ...
        (cris_supply_gregset): ... this.  Add REGCACHE parameter.  Use it
        instead of current_regcache.
        (fetch_core_registers): Update call.  Pass current_regcache.

diff -urNp gdb-orig/gdb/cris-tdep.c gdb-head/gdb/cris-tdep.c
--- gdb-orig/gdb/cris-tdep.c 2007-04-27 23:38:23.575663489 +0200
+++ gdb-head/gdb/cris-tdep.c 2007-04-27 23:37:59.611480099 +0200
@@ -3856,7 +3856,7 @@ typedef elf_greg_t crisv32_elf_gregset_t
 /* Unpack an elf_gregset_t into GDB's register cache.  */
 static void
-supply_gregset (elf_gregset_t *gregsetp)
+cris_supply_gregset (struct regcache *regcache, elf_gregset_t *gregsetp)
   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
   int i;
@@ -3867,7 +3867,7 @@ supply_gregset (elf_gregset_t *gregsetp)
      knows about the actual size of each register so that's no problem.  */
   for (i = 0; i < NUM_GENREGS + NUM_SPECREGS; i++)
-      regcache_raw_supply (current_regcache, i, (char *)&regp[i]);
+      regcache_raw_supply (regcache, i, (char *)&regp[i]);
   if (tdep->cris_version == 32)
@@ -3875,7 +3875,7 @@ supply_gregset (elf_gregset_t *gregsetp)
       /* Needed to set pseudo-register PC for CRISv32.  */
       /* FIXME: If ERP is in a delay slot at this point then the PC will
  be wrong.  Issue a warning to alert the user.  */
-      regcache_raw_supply (current_regcache, PC_REGNUM,
+      regcache_raw_supply (regcache, PC_REGNUM,
    (char *)&regp[ERP_REGNUM]);
       if (*(char *)&regp[ERP_REGNUM] & 0x1)
@@ -3903,7 +3903,7 @@ fetch_core_registers (char *core_reg_sec
           memcpy (&gregset, core_reg_sect, sizeof (gregset));
-          supply_gregset (&gregset);
+          cris_supply_gregset (current_regcache, &gregset);
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  [hidden email]