* solib-sunos.c (sunos_relocate_main_executable): Remove function.
[deliverable/binutils-gdb.git] / gdb / rs6000-nat.c
index 8e24bed0b06dd5bf68f23bf7ff670905ec9eff20..5f71850830e4c9a392d6f668518a16f29b9094fb 100644 (file)
@@ -28,7 +28,7 @@
 #include "xcoffsolib.h"
 #include "symfile.h"
 #include "objfiles.h"
-#include "libbfd.h"            /* For bfd_cache_lookup (FIXME) */
+#include "libbfd.h"            /* For bfd_default_set_arch_mach (FIXME) */
 #include "bfd.h"
 #include "gdb-stabs.h"
 #include "regcache.h"
@@ -73,7 +73,7 @@
 #ifndef ARCH3264
 # define ARCH64() 0
 #else
-# define ARCH64() (DEPRECATED_REGISTER_RAW_SIZE (0) == 8)
+# define ARCH64() (register_size (current_gdbarch, 0) == 8)
 #endif
 
 /* Union of 32-bit and 64-bit ".reg" core file sections. */
@@ -255,7 +255,7 @@ fetch_register (int regno)
             even if the register is really only 32 bits. */
          long long buf;
          rs6000_ptrace64 (PT_READ_GPR, PIDGET (inferior_ptid), nr, 0, (int *)&buf);
-         if (DEPRECATED_REGISTER_RAW_SIZE (regno) == 8)
+         if (register_size (current_gdbarch, regno) == 8)
            memcpy (addr, &buf, 8);
          else
            *addr = buf;
@@ -263,7 +263,7 @@ fetch_register (int regno)
     }
 
   if (!errno)
-    supply_register (regno, (char *) addr);
+    regcache_raw_supply (current_regcache, regno, (char *) addr);
   else
     {
 #if 0
@@ -283,7 +283,7 @@ store_register (int regno)
   int nr, isfloat;
 
   /* Fetch the register's value from the register cache.  */
-  regcache_collect (regno, addr);
+  regcache_raw_collect (current_regcache, regno, addr);
 
   /* -1 can be a successful return value, so infer errors from errno. */
   errno = 0;
@@ -324,7 +324,7 @@ store_register (int regno)
          /* PT_WRITE_GPR requires the buffer parameter to point to an 8-byte
             area, even if the register is really only 32 bits. */
          long long buf;
-         if (DEPRECATED_REGISTER_RAW_SIZE (regno) == 8)
+         if (register_size (current_gdbarch, regno) == 8)
            memcpy (&buf, addr, 8);
          else
            buf = *addr;
@@ -586,45 +586,60 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
 
   if (ARCH64 ())
     {
-      for (regi = 0; regi < 32; regi++)
-        supply_register (tdep->ppc_gp0_regnum + regi,
-                         (char *) &regs->r64.gpr[regi]);
+      for (regi = 0; regi < ppc_num_gprs; regi++)
+        regcache_raw_supply (current_regcache, tdep->ppc_gp0_regnum + regi,
+                            (char *) &regs->r64.gpr[regi]);
 
       if (tdep->ppc_fp0_regnum >= 0)
-        for (regi = 0; regi < 32; regi++)
-          supply_register (tdep->ppc_fp0_regnum + regi,
-                           (char *) &regs->r64.fpr[regi]);
-
-      supply_register (PC_REGNUM, (char *) &regs->r64.iar);
-      supply_register (tdep->ppc_ps_regnum, (char *) &regs->r64.msr);
-      supply_register (tdep->ppc_cr_regnum, (char *) &regs->r64.cr);
-      supply_register (tdep->ppc_lr_regnum, (char *) &regs->r64.lr);
-      supply_register (tdep->ppc_ctr_regnum, (char *) &regs->r64.ctr);
-      supply_register (tdep->ppc_xer_regnum, (char *) &regs->r64.xer);
+        for (regi = 0; regi < ppc_num_fprs; regi++)
+          regcache_raw_supply (current_regcache, tdep->ppc_fp0_regnum + regi,
+                              (char *) &regs->r64.fpr[regi]);
+
+      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);
+      regcache_raw_supply (current_regcache, tdep->ppc_lr_regnum,
+                          (char *) &regs->r64.lr);
+      regcache_raw_supply (current_regcache, tdep->ppc_ctr_regnum,
+                          (char *) &regs->r64.ctr);
+      regcache_raw_supply (current_regcache, tdep->ppc_xer_regnum,
+                          (char *) &regs->r64.xer);
       if (tdep->ppc_fpscr_regnum >= 0)
-        supply_register (tdep->ppc_fpscr_regnum, (char *) &regs->r64.fpscr);
+        regcache_raw_supply (current_regcache, tdep->ppc_fpscr_regnum,
+                            (char *) &regs->r64.fpscr);
     }
   else
     {
-      for (regi = 0; regi < 32; regi++)
-        supply_register (tdep->ppc_gp0_regnum + regi,
-                         (char *) &regs->r32.gpr[regi]);
+      for (regi = 0; regi < ppc_num_gprs; regi++)
+        regcache_raw_supply (current_regcache, tdep->ppc_gp0_regnum + regi,
+                            (char *) &regs->r32.gpr[regi]);
 
       if (tdep->ppc_fp0_regnum >= 0)
-        for (regi = 0; regi < 32; regi++)
-          supply_register (tdep->ppc_fp0_regnum + regi,
-                           (char *) &regs->r32.fpr[regi]);
-
-      supply_register (PC_REGNUM, (char *) &regs->r32.iar);
-      supply_register (tdep->ppc_ps_regnum, (char *) &regs->r32.msr);
-      supply_register (tdep->ppc_cr_regnum, (char *) &regs->r32.cr);
-      supply_register (tdep->ppc_lr_regnum, (char *) &regs->r32.lr);
-      supply_register (tdep->ppc_ctr_regnum, (char *) &regs->r32.ctr);
-      supply_register (tdep->ppc_xer_regnum, (char *) &regs->r32.xer);
+        for (regi = 0; regi < ppc_num_fprs; regi++)
+          regcache_raw_supply (current_regcache, tdep->ppc_fp0_regnum + regi,
+                              (char *) &regs->r32.fpr[regi]);
+
+      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);
+      regcache_raw_supply (current_regcache, tdep->ppc_lr_regnum,
+                          (char *) &regs->r32.lr);
+      regcache_raw_supply (current_regcache, tdep->ppc_ctr_regnum,
+                          (char *) &regs->r32.ctr);
+      regcache_raw_supply (current_regcache, tdep->ppc_xer_regnum,
+                          (char *) &regs->r32.xer);
       if (tdep->ppc_fpscr_regnum >= 0)
-        supply_register (tdep->ppc_fpscr_regnum, (char *) &regs->r32.fpscr);
+        regcache_raw_supply (current_regcache, tdep->ppc_fpscr_regnum,
+                            (char *) &regs->r32.fpscr);
       if (tdep->ppc_mq_regnum >= 0)
-       supply_register (tdep->ppc_mq_regnum, (char *) &regs->r32.mq);
+       regcache_raw_supply (current_regcache, tdep->ppc_mq_regnum,
+                            (char *) &regs->r32.mq);
     }
 }
 \f
This page took 0.025252 seconds and 4 git commands to generate.