* remote.c (getpkt): Only force retransmission ten times;
authorJohn Gilmore <gnu@cygnus>
Wed, 5 Aug 1992 08:46:44 +0000 (08:46 +0000)
committerJohn Gilmore <gnu@cygnus>
Wed, 5 Aug 1992 08:46:44 +0000 (08:46 +0000)
after that, assume bug in target code, and handle pkt anyway.

gdb/ChangeLog
gdb/remote.c

index f608dea6f6a3c7a95826a16dc3a56f5ff5252d3a..c4f2f0afb29ee22c886a725a338368a502795c50 100644 (file)
@@ -1,3 +1,8 @@
+Wed Aug  5 01:42:40 1992  John Gilmore  (gnu at cygnus.com)
+
+       * remote.c (getpkt):  Only force retransmission ten times;
+       after that, assume bug in target code, and handle pkt anyway.
+
 Mon Aug  3 17:06:20 1992  Stu Grossman  (grossman at cygnus.com)
 
        * configure.in:  Add support for apollo 68k under BSD environment.
index f8372db58b9dd7f52be4d4ca03466b939b0dc3d8..cb1ad341f13bbd9913cdb039fe9b0f8bb35bd780 100644 (file)
@@ -420,7 +420,7 @@ remote_wait (status)
 
   WSETEXIT ((*status), 0);
 
-  ofunc = (void (*)) signal (SIGINT, remote_interrupt);
+  ofunc = (void (*)()) signal (SIGINT, remote_interrupt);
   getpkt ((char *) buf);
   signal (SIGINT, ofunc);
 
@@ -793,6 +793,8 @@ getpkt (buf)
   unsigned char csum;
   int c;
   unsigned char c1, c2;
+  int retries = 0;
+#define MAX_RETRIES    10
 
 #if 0
   /* Sorry, this will cause all hell to break loose, i.e. we'll end
@@ -839,9 +841,18 @@ getpkt (buf)
        break;
       printf_filtered ("Bad checksum, sentsum=0x%x, csum=0x%x, buf=%s\n",
              (c1 << 4) + c2, csum & 0xff, buf);
+
       /* Try the whole thing again.  */
 whole:
-      write (remote_desc, "-", 1);
+      if (++retries < MAX_RETRIES)
+       {
+         write (remote_desc, "-", 1);
+       }
+      else
+       {
+         printf ("Ignoring packet error, continuing...\n");
+         break;
+       }
     }
 
 #if 0
This page took 0.029458 seconds and 4 git commands to generate.