This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
RFA: Patch to remote.c - Fix to recovery from lost ACK
- To: gdb-patches at sourceware dot cygnus dot com
- Subject: RFA: Patch to remote.c - Fix to recovery from lost ACK
- From: Fernando Nasser <fnasser at cygnus dot com>
- Date: Fri, 15 Sep 2000 16:59:04 -0400
- Organization: Red Hat , Inc. - Toronto
Andrew and me were looking at this code and we saw something that did not looked
right. I created this patch that I think straights things up.
2000-09-15 Fernando Nasser <fnasser@totem.to.cygnus.com>
* remote.c (putpkt_binary): Call read_frame, not getpkt. Log message.
(read_frame): Do not call error() on communication error when
reading checksum, but return failure instead and log message.
--
Fernando Nasser
Red Hat - Toronto E-Mail: fnasser@cygnus.com
Index: remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.23
diff -c -p -r1.23 remote.c
*** remote.c 2000/09/01 00:12:10 1.23
--- remote.c 2000/09/15 20:48:13
*************** putpkt_binary (char *buf, int cnt)
*** 3796,3804 ****
break; /* Retransmit buffer */
case '$':
{
/* It's probably an old response, and we're out of sync.
Just gobble up the packet and ignore it. */
! getpkt (junkbuf, sizeof_junkbuf, 0);
continue; /* Now, go look for + */
}
default:
--- 3796,3806 ----
break; /* Retransmit buffer */
case '$':
{
+ if (remote_debug)
+ fprintf_unfiltered (gdb_stdlog, "Packet instead of Ack, ignoring it\n");
/* It's probably an old response, and we're out of sync.
Just gobble up the packet and ignore it. */
! read_frame (junkbuf, sizeof_junkbuf);
continue; /* Now, go look for + */
}
default:
*************** read_frame (char *buf,
*** 3887,3893 ****
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)
--- 3889,3899 ----
return -1;
}
else if (check_0 < 0 || check_1 < 0)
! {
! if (remote_debug)
! fputs_filtered ("Communication error in checksum\n", gdb_stdlog);
! return -1;
! }
pktcsum = (fromhex (check_0) << 4) | fromhex (check_1);
if (csum == pktcsum)