From mboxrd@z Thu Jan 1 00:00:00 1970 From: jtc@redbacknetworks.com (J.T. Conklin) To: gdb-patches@cygnus.com Subject: Patch to support NACK packet from stub Date: Thu, 01 Apr 1999 00:00:00 -0000 Message-id: <5mu2vqw2co.fsf@jtc.redbacknetworks.com> X-SW-Source: 1999-q1/msg00086.html I discovered that the putpkt() routine does not handle NACK ('-') packets from remote stub, instead the NACK is junked and putpkt() waits until the subsequent read times out. This is a big penalty (the default value of remote_timeout is 20 seconds) that can be easily avoided. However, I had the '-' case fall through to SERIAL_TIMEOUT so the number of attempts a packet is sent is the same as timeouts. If we wanted to add a remote_debug for the SERIAL_TIMEOUT case, that code needs to duplicated. --jtc 1999-03-12 J.T. Conklin * remote.c (putpkt): Handle NACK ('-') packet from stub. Index: remote.c =================================================================== RCS file: /usr/rback/release/tools-src/gdb/gdb/remote.c,v retrieving revision 1.5 diff -c -r1.5 remote.c *** remote.c 1999/02/15 21:33:55 1.5 --- remote.c 1999/03/13 02:20:20 *************** *** 2537,2542 **** --- 2537,2543 ---- switch (ch) { case '+': + case '-': case SERIAL_TIMEOUT: case '$': if (started_error_output) *************** *** 2553,2558 **** --- 2554,2563 ---- if (remote_debug) printf_unfiltered ("Ack\n"); return 1; + case '-': + if (remote_debug) + printf_unfiltered ("Nack\n"); + /* FALLTHROUGH */ case SERIAL_TIMEOUT: tcount ++; if (tcount > 3) -- J.T. Conklin RedBack Networks From mboxrd@z Thu Jan 1 00:00:00 1970 From: jtc@redbacknetworks.com (J.T. Conklin) To: gdb-patches@cygnus.com Subject: Patch to support NACK packet from stub Date: Fri, 12 Mar 1999 18:28:00 -0000 Message-ID: <5mu2vqw2co.fsf@jtc.redbacknetworks.com> X-SW-Source: 1999-03/msg00032.html Message-ID: <19990312182800.nTNJNVBzqiaxwMYtjEjWW3NNY-zXmLHaKA1rgr8IkRQ@z> I discovered that the putpkt() routine does not handle NACK ('-') packets from remote stub, instead the NACK is junked and putpkt() waits until the subsequent read times out. This is a big penalty (the default value of remote_timeout is 20 seconds) that can be easily avoided. However, I had the '-' case fall through to SERIAL_TIMEOUT so the number of attempts a packet is sent is the same as timeouts. If we wanted to add a remote_debug for the SERIAL_TIMEOUT case, that code needs to duplicated. --jtc 1999-03-12 J.T. Conklin * remote.c (putpkt): Handle NACK ('-') packet from stub. Index: remote.c =================================================================== RCS file: /usr/rback/release/tools-src/gdb/gdb/remote.c,v retrieving revision 1.5 diff -c -r1.5 remote.c *** remote.c 1999/02/15 21:33:55 1.5 --- remote.c 1999/03/13 02:20:20 *************** *** 2537,2542 **** --- 2537,2543 ---- switch (ch) { case '+': + case '-': case SERIAL_TIMEOUT: case '$': if (started_error_output) *************** *** 2553,2558 **** --- 2554,2563 ---- if (remote_debug) printf_unfiltered ("Ack\n"); return 1; + case '-': + if (remote_debug) + printf_unfiltered ("Nack\n"); + /* FALLTHROUGH */ case SERIAL_TIMEOUT: tcount ++; if (tcount > 3) -- J.T. Conklin RedBack Networks