2007-05-08 Paul Gilliam <pgilliam@us.ibm.com>
[deliverable/binutils-gdb.git] / gdb / remote-mips.c
index 4c6fdf8ea1445c01c6afc3bb223dc80db48ab6d9..5c2954db2470471e80cc8b9b084231f35d7b9879 100644 (file)
@@ -32,7 +32,6 @@
 #include "serial.h"
 #include "target.h"
 #include "exceptions.h"
-#include "remote-utils.h"
 #include "gdb_string.h"
 #include "gdb_stat.h"
 #include "regcache.h"
@@ -97,18 +96,18 @@ static ptid_t mips_wait (ptid_t ptid,
 
 static int mips_map_regno (int regno);
 
-static void mips_fetch_registers (int regno);
+static void mips_fetch_registers (struct regcache *regcache, int regno);
 
-static void mips_prepare_to_store (void);
+static void mips_prepare_to_store (struct regcache *regcache);
 
-static void mips_store_registers (int regno);
+static void mips_store_registers (struct regcache *regcache, int regno);
 
 static unsigned int mips_fetch_word (CORE_ADDR addr);
 
 static int mips_store_word (CORE_ADDR addr, unsigned int value,
                            char *old_contents);
 
-static int mips_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len,
+static int mips_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len,
                             int write, 
                             struct mem_attrib *attrib,
                             struct target_ops *target);
@@ -1584,7 +1583,7 @@ device is attached to the target board (e.g., /dev/ttya).\n"
      of some sort.  That doesn't happen here (in fact, it may not be
      possible to get the monitor to send the appropriate packet).  */
 
-  flush_cached_frames ();
+  reinit_frame_cache ();
   registers_changed ();
   stop_pc = read_pc ();
   print_stack_frame (get_selected_frame (NULL), 0, SRC_AND_LOC);
@@ -1893,7 +1892,7 @@ mips_map_regno (int regno)
 /* Fetch the remote registers.  */
 
 static void
-mips_fetch_registers (int regno)
+mips_fetch_registers (struct regcache *regcache, int regno)
 {
   unsigned LONGEST val;
   int err;
@@ -1901,7 +1900,7 @@ mips_fetch_registers (int regno)
   if (regno == -1)
     {
       for (regno = 0; regno < NUM_REGS; regno++)
-       mips_fetch_registers (regno);
+       mips_fetch_registers (regcache, regno);
       return;
     }
 
@@ -1939,7 +1938,7 @@ mips_fetch_registers (int regno)
     /* We got the number the register holds, but gdb expects to see a
        value in the target byte ordering.  */
     store_unsigned_integer (buf, register_size (current_gdbarch, regno), val);
-    regcache_raw_supply (current_regcache, regno, buf);
+    regcache_raw_supply (regcache, regno, buf);
   }
 }
 
@@ -1947,26 +1946,27 @@ mips_fetch_registers (int regno)
    registers, so this function doesn't have to do anything.  */
 
 static void
-mips_prepare_to_store (void)
+mips_prepare_to_store (struct regcache *regcache)
 {
 }
 
 /* Store remote register(s).  */
 
 static void
-mips_store_registers (int regno)
+mips_store_registers (struct regcache *regcache, int regno)
 {
+  ULONGEST val;
   int err;
 
   if (regno == -1)
     {
       for (regno = 0; regno < NUM_REGS; regno++)
-       mips_store_registers (regno);
+       mips_store_registers (regcache, regno);
       return;
     }
 
-  mips_request ('R', mips_map_regno (regno),
-               read_register (regno),
+  regcache_cooked_read_unsigned (regcache, regno, &val);
+  mips_request ('R', mips_map_regno (regno), val,
                &err, mips_receive_wait, NULL);
   if (err)
     mips_error ("Can't write register %d: %s", regno, safe_strerror (errno));
@@ -2029,7 +2029,7 @@ mips_store_word (CORE_ADDR addr, unsigned int val, char *old_contents)
 static int mask_address_p = 1;
 
 static int
-mips_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
+mips_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len, int write,
                  struct mem_attrib *attrib, struct target_ops *target)
 {
   int i;
This page took 0.026894 seconds and 4 git commands to generate.