*** empty log message ***
[deliverable/binutils-gdb.git] / gdb / hppa-linux-nat.c
index d8f683477a204c09d005b93ad550bb6f5e293162..ee24856855d04a4cb4fedff1bfefddb0ff9d9e4d 100644 (file)
@@ -153,8 +153,8 @@ static const int u_offsets[] =
     PT_FR31, PT_FR31 + 4,
   };
 
-CORE_ADDR
-register_addr (int regno, CORE_ADDR blockend)
+static CORE_ADDR
+hppa_linux_register_addr (int regno, CORE_ADDR blockend)
 {
   CORE_ADDR addr;
 
@@ -216,14 +216,14 @@ static const int greg_map[] =
 /* Fetch one register.  */
 
 static void
-fetch_register (int regno)
+fetch_register (struct regcache *regcache, int regno)
 {
   int tid;
   int val;
 
   if (CANNOT_FETCH_REGISTER (regno))
     {
-      regcache_raw_supply (current_regcache, regno, NULL);
+      regcache_raw_supply (regcache, regno, NULL);
       return;
     }
 
@@ -233,18 +233,18 @@ fetch_register (int regno)
     tid = PIDGET (inferior_ptid); /* Not a threaded program.  */
 
   errno = 0;
-  val = ptrace (PTRACE_PEEKUSER, tid, register_addr (regno, 0), 0);
+  val = ptrace (PTRACE_PEEKUSER, tid, hppa_linux_register_addr (regno, 0), 0);
   if (errno != 0)
     error (_("Couldn't read register %s (#%d): %s."), REGISTER_NAME (regno),
           regno, safe_strerror (errno));
 
-  regcache_raw_supply (current_regcache, regno, &val);
+  regcache_raw_supply (regcache, regno, &val);
 }
 
 /* Store one register. */
 
 static void
-store_register (int regno)
+store_register (const struct regcache *regcache, int regno)
 {
   int tid;
   int val;
@@ -258,8 +258,8 @@ store_register (int regno)
     tid = PIDGET (inferior_ptid); /* Not a threaded program.  */
 
   errno = 0;
-  regcache_raw_collect (current_regcache, regno, &val);
-  ptrace (PTRACE_POKEUSER, tid, register_addr (regno, 0), val);
+  regcache_raw_collect (regcache, regno, &val);
+  ptrace (PTRACE_POKEUSER, tid, hppa_linux_register_addr (regno, 0), val);
   if (errno != 0)
     error (_("Couldn't write register %s (#%d): %s."), REGISTER_NAME (regno),
           regno, safe_strerror (errno));
@@ -270,16 +270,16 @@ store_register (int regno)
    point registers depending upon the value of regno.  */
 
 static void
-hppa_linux_fetch_inferior_registers (int regno)
+hppa_linux_fetch_inferior_registers (struct regcache *regcache, int regno)
 {
   if (-1 == regno)
     {
       for (regno = 0; regno < NUM_REGS; regno++)
-        fetch_register (regno);
+        fetch_register (regcache, regno);
     }
   else 
     {
-      fetch_register (regno);
+      fetch_register (regcache, regno);
     }
 }
 
@@ -288,16 +288,16 @@ hppa_linux_fetch_inferior_registers (int regno)
    point registers depending upon the value of regno.  */
 
 static void
-hppa_linux_store_inferior_registers (int regno)
+hppa_linux_store_inferior_registers (struct regcache *regcache, int regno)
 {
   if (-1 == regno)
     {
       for (regno = 0; regno < NUM_REGS; regno++)
-       store_register (regno);
+       store_register (regcache, regno);
     }
   else
     {
-      store_register (regno);
+      store_register (regcache, regno);
     }
 }
 
@@ -305,15 +305,15 @@ hppa_linux_store_inferior_registers (int regno)
    in *gregsetp.  */
 
 void
-supply_gregset (gdb_gregset_t *gregsetp)
+supply_gregset (struct regcache *regcache, const gdb_gregset_t *gregsetp)
 {
   int i;
-  greg_t *regp = (elf_greg_t *) gregsetp;
+  const greg_t *regp = (const elf_greg_t *) gregsetp;
 
   for (i = 0; i < sizeof (greg_map) / sizeof (greg_map[0]); i++, regp++)
     {
       int regno = greg_map[i];
-      regcache_raw_supply (current_regcache, regno, regp);
+      regcache_raw_supply (regcache, regno, regp);
     }
 }
 
@@ -322,7 +322,8 @@ supply_gregset (gdb_gregset_t *gregsetp)
    If regno is -1, do this for all registers.  */
 
 void
-fill_gregset (gdb_gregset_t *gregsetp, int regno)
+fill_gregset (const struct regcache *regcache,
+             gdb_gregset_t *gregsetp, int regno)
 {
   int i;
 
@@ -332,7 +333,7 @@ fill_gregset (gdb_gregset_t *gregsetp, int regno)
 
       if (regno == -1 || regno == mregno)
        {
-          regcache_raw_collect(current_regcache, mregno, &(*gregsetp)[i]);
+          regcache_raw_collect(regcache, mregno, &(*gregsetp)[i]);
        }
     }
 }
@@ -342,17 +343,16 @@ fill_gregset (gdb_gregset_t *gregsetp, int regno)
    idea of the current floating point register values. */
 
 void
-supply_fpregset (gdb_fpregset_t *fpregsetp)
+supply_fpregset (struct regcache *regcache, const gdb_fpregset_t *fpregsetp)
 {
   int regi;
-  char *from;
+  const char *from;
 
   for (regi = 0; regi <= 31; regi++)
     {
-      from = (char *) &((*fpregsetp)[regi]);
-      regcache_raw_supply (current_regcache, 2*regi + HPPA_FP0_REGNUM, from);
-      regcache_raw_supply (current_regcache, 2*regi + HPPA_FP0_REGNUM + 1,
-                          from + 4);
+      from = (const char *) &((*fpregsetp)[regi]);
+      regcache_raw_supply (regcache, 2*regi + HPPA_FP0_REGNUM, from);
+      regcache_raw_supply (regcache, 2*regi + HPPA_FP0_REGNUM + 1, from + 4);
     }
 }
 
@@ -362,7 +362,8 @@ supply_fpregset (gdb_fpregset_t *fpregsetp)
    them all. */
 
 void
-fill_fpregset (gdb_fpregset_t *fpregsetp, int regno)
+fill_fpregset (const struct regcache *regcache,
+              gdb_fpregset_t *fpregsetp, int regno)
 {
   int i;
 
@@ -373,7 +374,7 @@ fill_fpregset (gdb_fpregset_t *fpregsetp, int regno)
       char *to = (char *) &((*fpregsetp)[(i - HPPA_FP0_REGNUM) / 2]);
       if ((i - HPPA_FP0_REGNUM) & 1)
        to += 4;
-      regcache_raw_collect (current_regcache, i, to);
+      regcache_raw_collect (regcache, i, to);
    }
 }
 
This page took 0.02645 seconds and 4 git commands to generate.