This is the mail archive of the
mailing list for the GDB project.
PATCH: handle NAK packets sent by remote stub.
- To: gdb-patches at sourceware dot cygnus dot com
- Subject: PATCH: handle NAK packets sent by remote stub.
- From: jtc at redback dot com (J.T. Conklin)
- Date: 05 Feb 2000 16:56:51 -0800
- Reply-To: jtc at redback dot com
This patch wasn't lost, but rather deferred for further thought just
before the 4.18 branch/release.
The putpkt_binary() function doesn't specifically handle the NAK ('-')
character after a packet has been transmitted. It's treated as a junk
character and ignored. As a result, in the case of packet corruption,
GDB waits remote_timeout seconds to re-try the packet even though the
target has told GDB that the packet needs to be retransmitted. The
enclosed patch handles Nak, so the packet is retransmitted immediately.
The one concern that I remember was the risk of spurious NAKs from the
target interfering with the proper operation remote protocol. This is
a possibility, but in my opinion it's no more so than spurious ACKs.
Without ACKs and NAKs being framed/checksummed, the remote protocol is
simply vulnerable to communication errors.
We've had this change in our local GDBs for about a year. It has
caused no problems that I'm aware of.
I submitted this patch before I started archiving my outbound mail.
So this time, the ChangeLog is new.
2000-02-05 J.T. Conklin <firstname.lastname@example.org>
* remote.c (putpkt_binary): Handle NAK from target stub.
RCS file: /home/jtc/CVSROOT/gdb/gdb/remote.c,v
retrieving revision 18.104.22.168
retrieving revision 1.19
diff -c -r22.214.171.124 -r1.19
*** remote.c 2000/02/04 21:24:02 126.96.36.199
--- remote.c 2000/02/04 23:52:40 1.19
*** 3730,3735 ****
--- 3721,3727 ----
+ case '-':
*** 3746,3751 ****
--- 3738,3746 ----
fprintf_unfiltered (gdb_stdlog, "Ack\n");
+ case '-':
+ if (remote_debug)
+ fprintf_unfiltered (gdb_stdlog, "Nak\n");
if (tcount > 3)