* lin-lwp.c (stop_wait_callback): Remove bogus assertions in the
[deliverable/binutils-gdb.git] / gdb / remote.c
index 9fe2a29ed107c5606eb314b5512a3604dbb15e41..b58911ce58acc635af721338f84f14dd8582e1f5 100644 (file)
@@ -1975,7 +1975,7 @@ remote_start_remote_dummy (void *dummy)
 static int
 remote_start_remote (PTR dummy)
 {
-  immediate_quit = 1;          /* Allow user to interrupt it */
+  immediate_quit++;            /* Allow user to interrupt it */
 
   /* Ack any packet which the remote side has already sent.  */
   SERIAL_WRITE (remote_desc, "+", 1);
@@ -1988,7 +1988,7 @@ remote_start_remote (PTR dummy)
   get_offsets ();              /* Get text, data & bss offsets */
 
   putpkt ("?");                        /* initiate a query from remote machine */
-  immediate_quit = 0;
+  immediate_quit--;
 
   return remote_start_remote_dummy (dummy);
 }
@@ -2057,7 +2057,10 @@ serial device is attached to the remote system\n\
 
   unpush_target (target);
 
-  remote_dcache = dcache_init (remote_read_bytes, remote_write_bytes);
+  if (!remote_dcache)
+    remote_dcache = dcache_init (remote_read_bytes, remote_write_bytes);
+  else
+    dcache_invd (remote_dcache);
 
   remote_desc = SERIAL_OPEN (name);
   if (!remote_desc)
@@ -2306,7 +2309,7 @@ remote_resume (int pid, int step, enum target_signal siggnal)
   else
     set_thread (pid, 0);       /* run this thread */
 
-  dcache_flush (remote_dcache);
+  dcache_invd (remote_dcache);
 
   last_sent_signal = siggnal;
   last_sent_step = step;
@@ -2340,7 +2343,7 @@ remote_async_resume (int pid, int step, enum target_signal siggnal)
   else
     set_thread (pid, 0);       /* run this thread */
 
-  dcache_flush (remote_dcache);
+  dcache_invd (remote_dcache);
 
   last_sent_signal = siggnal;
   last_sent_step = step;
@@ -3868,12 +3871,25 @@ read_frame (char *buf,
        case '#':
          {
            unsigned char pktcsum;
+           int check_0 = 0;
+           int check_1 = 0;
 
            buf[bc] = '\0';
 
-           pktcsum = fromhex (readchar (remote_timeout)) << 4;
-           pktcsum |= fromhex (readchar (remote_timeout));
+           check_0 = readchar (remote_timeout);
+           if (check_0 >= 0)
+             check_1 = readchar (remote_timeout);
+           
+           if (check_0 == SERIAL_TIMEOUT || check_1 == SERIAL_TIMEOUT)
+             {
+               if (remote_debug)
+                 fputs_filtered ("Timeout in checksum, retrying\n", gdb_stdlog);
+               return -1;
+             }
+           else if (check_0 < 0 || check_1 < 0)
+             error ("Communication error in checksum");
 
+           pktcsum = (fromhex (check_0) << 4) | fromhex (check_1);
            if (csum == pktcsum)
               return bc;
 
@@ -5034,7 +5050,10 @@ device is attached to the remote system (e.g. host:port).");
 
   unpush_target (&remote_cisco_ops);
 
-  remote_dcache = dcache_init (remote_read_bytes, remote_write_bytes);
+  if (!remote_dcache)
+    remote_dcache = dcache_init (remote_read_bytes, remote_write_bytes);
+  else
+    dcache_invd (remote_dcache);
 
   remote_desc = SERIAL_OPEN (name);
   if (!remote_desc)
This page took 0.036942 seconds and 4 git commands to generate.