* MAINTAINERS: Added self and Andrew for the ppc sim.
[deliverable/binutils-gdb.git] / gdb / monitor.c
index e3fa1c81fad3f2ec1f84729a134ba1cf3baa4693..869a91e2928ebfd4c5bbf9bc9ca8fbb99a789b82 100644 (file)
@@ -521,7 +521,7 @@ monitor_expect (char *string, char *buf, int buflen)
       fprintf_unfiltered (gdb_stdlog, "MON Expecting '%s'\n", safe_string);
     }
 
-  immediate_quit = 1;
+  immediate_quit++;
   while (1)
     {
       if (buf)
@@ -529,7 +529,7 @@ monitor_expect (char *string, char *buf, int buflen)
          if (buflen < 2)
            {
              *buf = '\000';
-             immediate_quit = 0;
+             immediate_quit--;
              return -1;
            }
 
@@ -549,7 +549,7 @@ monitor_expect (char *string, char *buf, int buflen)
          p++;
          if (*p == '\0')
            {
-             immediate_quit = 0;
+             immediate_quit--;
 
              if (buf)
                {
@@ -838,10 +838,15 @@ monitor_open (char *args, struct monitor_ops *mon_ops, int from_tty)
 
   monitor_printf (current_monitor->line_term);
 
+  if (remote_dcache)
+    dcache_free (remote_dcache);
+
   if (current_monitor->flags & MO_HAS_BLOCKWRITES)
-    remote_dcache = dcache_init (monitor_read_memory, monitor_write_memory_block);
+    remote_dcache = dcache_init (monitor_read_memory, 
+                                monitor_write_memory_block);
   else
     remote_dcache = dcache_init (monitor_read_memory, monitor_write_memory);
+
   start_remote ();
 }
 
@@ -927,7 +932,7 @@ monitor_supply_register (int regno, char *valstr)
 void
 flush_monitor_dcache (void)
 {
-  dcache_flush (remote_dcache);
+  dcache_invd (remote_dcache);
 }
 
 static void
@@ -943,7 +948,7 @@ monitor_resume (int pid, int step, enum target_signal sig)
        dump_reg_flag = 1;
       return;
     }
-  dcache_flush (remote_dcache);
+  dcache_invd (remote_dcache);
   if (step)
     monitor_printf (current_monitor->step);
   else
@@ -1995,13 +2000,13 @@ monitor_read_memory (CORE_ADDR memaddr, char *myaddr, int len)
   return len;
 }
 
+/* Transfer LEN bytes between target address MEMADDR and GDB address
+   MYADDR.  Returns 0 for success, errno code for failure. TARGET is
+   unused. */
+
 static int
-monitor_xfer_memory (memaddr, myaddr, len, write, target)
-     CORE_ADDR memaddr;
-     char *myaddr;
-     int len;
-     int write;
-     struct target_ops *target;        /* ignored */
+monitor_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
+                    struct target_ops *target)
 {
   return dcache_xfer_memory (remote_dcache, memaddr, myaddr, len, write);
 }
@@ -2140,7 +2145,7 @@ monitor_wait_srec_ack (void)
 static void
 monitor_load (char *file, int from_tty)
 {
-  dcache_flush (remote_dcache);
+  dcache_invd (remote_dcache);
   monitor_debug ("MON load\n");
 
   if (current_monitor->load_routine)
This page took 0.025494 seconds and 4 git commands to generate.