2001-01-02 Michael Snyder <msnyder@cleaver.cygnus.com>
[deliverable/binutils-gdb.git] / gdb / remote-bug.c
index aac148eb5f4e39d4a52d86df1697fef5210b9f1b..73d37b7255b10d323117850f3bbb997ee2dfd7ea 100644 (file)
@@ -119,7 +119,6 @@ bug_load (char *args, int fromtty)
 
   sr_check_open ();
 
-  dcache_invd (gr_get_dcache ());
   inferior_pid = 0;
   abfd = bfd_openr (args, 0);
   if (!abfd)
@@ -157,7 +156,7 @@ bug_load (char *args, int fromtty)
              gdb_flush (gdb_stdout);
            }
          printf_filtered ("\n");
-         free (buffer);
+         xfree (buffer);
        }
       s = s->next;
     }
@@ -198,12 +197,9 @@ get_word (char **p)
 
 static struct gr_settings bug_settings =
 {
-  NULL,                                /* dcache */
   "Bug>",                      /* prompt */
   &bug_ops,                    /* ops */
   bug_clear_breakpoints,       /* clear_all_breakpoints */
-  bug_read_memory,             /* readfunc */
-  bug_write_memory,            /* writefunc */
   gr_generic_checkin,          /* checkin */
 };
 
@@ -242,8 +238,6 @@ bug_open (char *args, int from_tty)
 void
 bug_resume (int pid, int step, enum target_signal sig)
 {
-  dcache_invd (gr_get_dcache ());
-
   if (step)
     {
       sr_write_cr ("t");
@@ -553,18 +547,27 @@ bug_store_register (int regno)
   return;
 }
 
+/* Transfer LEN bytes between GDB address MYADDR and target address
+   MEMADDR.  If WRITE is non-zero, transfer them to the target,
+   otherwise transfer them from the target.  TARGET is unused.
+
+   Returns the number of bytes transferred. */
+
 int
-bug_xfer_memory (memaddr, myaddr, len, write, target)
-     CORE_ADDR memaddr;
-     char *myaddr;
-     int len;
-     int write;
-     struct target_ops *target;        /* ignored */
+bug_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
+                struct target_ops *target)
 {
+  int res;
+
   if (len <= 0)
     return 0;
 
-  return dcache_xfer_memory (gr_get_dcache (), memaddr, myaddr, len, write);
+  if (write)
+    res = bug_write_memory (memaddr, myaddr, len);
+  else
+    res = bug_read_memory (memaddr, myaddr, len);
+
+  return res;
 }
 
 static void
@@ -823,10 +826,14 @@ done:
 
 #define MAX_BREAKS     16
 static int num_brkpts = 0;
+
+/* Insert a breakpoint at ADDR.  SAVE is normally the address of the
+   pattern buffer where the instruction that the breakpoint overwrites
+   is saved.  It is unused here since the bug is responsible for
+   saving/restoring the original instruction. */
+
 static int
-bug_insert_breakpoint (addr, save)
-     CORE_ADDR addr;
-     char *save;               /* Throw away, let bug save instructions */
+bug_insert_breakpoint (CORE_ADDR addr, char *save)
 {
   sr_check_open ();
 
@@ -848,10 +855,13 @@ bug_insert_breakpoint (addr, save)
     }
 
 }
+
+/* Remove a breakpoint at ADDR.  SAVE is normally the previously
+   saved pattern, but is unused here since the bug is responsible
+   for saving/restoring instructions. */
+
 static int
-bug_remove_breakpoint (addr, save)
-     CORE_ADDR addr;
-     char *save;               /* Throw away, let bug save instructions */
+bug_remove_breakpoint (CORE_ADDR addr, char *save)
 {
   if (num_brkpts > 0)
     {
This page took 0.02426 seconds and 4 git commands to generate.