* (struct remote_state): New type, only containing
[deliverable/binutils-gdb.git] / gdb / ppc-bdm.c
index 59fac1fde2dc07941abd0df588f6b7451a27bd6e..96ea612c974ea5f12de7c0f1f50d26765fda6895 100644 (file)
@@ -1,6 +1,6 @@
 /* Remote target communications for the Macraigor Systems BDM Wiggler
    talking to a Motorola PPC 8xx ADS board
-   Copyright 1996, 1997, 1998, 1999, 2000, 2001
+   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
    Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -17,8 +17,8 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   Foundation, Inc., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
 
 #include "defs.h"
 #include "gdbcore.h"
@@ -37,6 +37,7 @@
 #include "ocd.h"
 #include "ppc-tdep.h"
 #include "regcache.h"
+#include "gdb_assert.h"
 
 static void bdm_ppc_open (char *name, int from_tty);
 
@@ -155,20 +156,10 @@ bdm_ppc_fetch_registers (int regno)
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
   int i;
-  unsigned char *regs, *beginregs, *endregs, *almostregs;
-  unsigned char midregs[32];
-  unsigned char mqreg[1];
+  unsigned char *regs;
   int first_regno, last_regno;
   int first_bdm_regno, last_bdm_regno;
-  int reglen, beginreglen, endreglen;
-
-#if 1
-  for (i = 0; i < ppc_num_fprs; i++)
-    {
-      midregs[i] = -1;
-    }
-  mqreg[0] = -1;
-#endif
+  int reglen;
 
   if (regno == -1)
     {
@@ -189,10 +180,16 @@ bdm_ppc_fetch_registers (int regno)
 
   if (first_bdm_regno == -1)
     {
-      supply_register (first_regno, NULL);
+      regcache_raw_supply (current_regcache, first_regno, NULL);
       return;                  /* Unsupported register */
     }
 
+  /* FIXME: jimb/2004-05-04: I'm not sure how to adapt this code to
+     processors that lack floating point registers, and I don't have
+     have the equipment to test it.  So we'll leave that case for the
+     next person who encounters it.  */
+  gdb_assert (ppc_floating_point_unit_p (current_gdbarch));
+
 #if 1
   /* Can't ask for floating point regs on ppc 8xx, also need to
      avoid asking for the mq register. */
@@ -207,7 +204,7 @@ bdm_ppc_fetch_registers (int regno)
               && (first_regno < tdep->ppc_fp0_regnum + ppc_num_fprs)))
        {
 /*          printf("invalid reg request!\n"); */
-         supply_register (first_regno, NULL);
+         regcache_raw_supply (current_regcache, first_regno, NULL);
          return;               /* Unsupported register */
        }
       else
@@ -217,20 +214,9 @@ bdm_ppc_fetch_registers (int regno)
        }
     }
   else
-    /* want all regs */
-    {
-/*      printf("Asking for registers %d to %d\n", first_regno, last_regno); */
-      beginregs = ocd_read_bdm_registers (first_bdm_regno,
-                                         tdep->ppc_fp0_regnum - 1,
-                                          &beginreglen);
-      endregs
-        = (strcat (midregs,
-                   ocd_read_bdm_registers (tdep->ppc_fp0_regnum + ppc_num_fprs,
-                                           last_bdm_regno - 1, &endreglen)));
-      almostregs = (strcat (beginregs, endregs));
-      regs = (strcat (almostregs, mqreg));
-      reglen = beginreglen + 32 + endreglen + 1;
-    }
+    internal_error (__FILE__, __LINE__,
+                    _("ppc_bdm_fetch_registers: "
+                    "'all registers' case not implemented"));
 
 #endif
 #if 0
@@ -249,10 +235,10 @@ bdm_ppc_fetch_registers (int regno)
          if (regoffset >= reglen / 4)
            continue;
 
-         supply_register (i, regs + 4 * regoffset);
+         regcache_raw_supply (current_regcache, i, regs + 4 * regoffset);
        }
       else
-       supply_register (i, NULL);      /* Unsupported register */
+       regcache_raw_supply (current_regcache, i, NULL);        /* Unsupported register */
     }
 }
 
@@ -287,6 +273,12 @@ bdm_ppc_store_registers (int regno)
   if (first_bdm_regno == -1)
     return;                    /* Unsupported register */
 
+  /* FIXME: jimb/2004-05-04: I'm not sure how to adapt this code to
+     processors that lack floating point registers, and I don't have
+     have the equipment to test it.  So we'll leave that case for the
+     next person who encounters it.  */
+  gdb_assert (ppc_floating_point_unit_p (current_gdbarch));
+
   for (i = first_regno; i <= last_regno; i++)
     {
       int bdm_regno;
@@ -333,7 +325,7 @@ a wiggler, specify wiggler and then the port it is connected to\n\
   bdm_ppc_ops.to_fetch_registers = bdm_ppc_fetch_registers;
   bdm_ppc_ops.to_store_registers = bdm_ppc_store_registers;
   bdm_ppc_ops.to_prepare_to_store = ocd_prepare_to_store;
-  bdm_ppc_ops.to_xfer_memory = ocd_xfer_memory;
+  bdm_ppc_ops.deprecated_xfer_memory = ocd_xfer_memory;
   bdm_ppc_ops.to_files_info = ocd_files_info;
   bdm_ppc_ops.to_insert_breakpoint = ocd_insert_breakpoint;
   bdm_ppc_ops.to_remove_breakpoint = ocd_remove_breakpoint;
This page took 0.032362 seconds and 4 git commands to generate.