aboutsummaryrefslogtreecommitdiff
path: root/gdb/remote.c
diff options
context:
space:
mode:
authorJohn Gilmore <gnu@cygnus>1992-08-05 08:46:44 +0000
committerJohn Gilmore <gnu@cygnus>1992-08-05 08:46:44 +0000
commit38094c60330686e8f69dfcc8c2c5d2316f622cd1 (patch)
treec8bf39489c57de3b83acdf2e3969afee3286b935 /gdb/remote.c
parent917bffa7f6dd3a04195a790595a2088683386227 (diff)
downloadfsf-binutils-gdb-38094c60330686e8f69dfcc8c2c5d2316f622cd1.zip
fsf-binutils-gdb-38094c60330686e8f69dfcc8c2c5d2316f622cd1.tar.gz
fsf-binutils-gdb-38094c60330686e8f69dfcc8c2c5d2316f622cd1.tar.bz2
* remote.c (getpkt): Only force retransmission ten times;
after that, assume bug in target code, and handle pkt anyway.
Diffstat (limited to 'gdb/remote.c')
-rw-r--r--gdb/remote.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/gdb/remote.c b/gdb/remote.c
index f8372db..cb1ad34 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -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