* solib-sunos.c [HAVE_STRUCT_SO_MAP_WITH_SOM_MEMBERS] (link_map)
[deliverable/binutils-gdb.git] / gdb / rs6000-nat.c
index bf08b946d0981f406134cf98bf194941b158668a..df360763f42edc01f5ac0ae4f7bb0f3630a04a23 100644 (file)
 #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"
 #include "arch-utils.h"
-#include "language.h"          /* for local_hex_string().  */
 #include "ppc-tdep.h"
 #include "exec.h"
 
@@ -73,7 +72,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 +254,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 +262,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 +282,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 +323,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;
@@ -443,10 +442,10 @@ read_word (CORE_ADDR from, int *to, int arch64)
    to debugger memory starting at MYADDR.  Copy to inferior if
    WRITE is nonzero.
 
-   Returns the length copied, which is either the LEN argument or zero.
-   This xfer function does not do partial moves, since child_ops
-   doesn't allow memory operations to cross below us in the target stack
-   anyway.  */
+   Returns the length copied, which is either the LEN argument or
+   zero.  This xfer function does not do partial moves, since
+   deprecated_child_ops doesn't allow memory operations to cross below
+   us in the target stack anyway.  */
 
 int
 child_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len,
@@ -587,44 +586,59 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
   if (ARCH64 ())
     {
       for (regi = 0; regi < ppc_num_gprs; regi++)
-        supply_register (tdep->ppc_gp0_regnum + regi,
-                         (char *) &regs->r64.gpr[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 < ppc_num_fprs; 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);
+          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 < ppc_num_gprs; regi++)
-        supply_register (tdep->ppc_gp0_regnum + regi,
-                         (char *) &regs->r32.gpr[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 < ppc_num_fprs; 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);
+          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
@@ -1214,7 +1228,7 @@ find_toc_address (CORE_ADDR pc)
                                              : vp->objfile);
        }
     }
-  error ("Unable to find TOC entry for pc %s\n", local_hex_string (pc));
+  error ("Unable to find TOC entry for pc %s\n", hex_string (pc));
 }
 \f
 /* Register that we are able to handle rs6000 core file formats. */
This page took 0.025997 seconds and 4 git commands to generate.