From mboxrd@z Thu Jan 1 00:00:00 1970 From: jtc@redbacknetworks.com (J.T. Conklin) To: gdb-patches@cygnus.com Subject: m68k-stub.c patch, putpacket should wait for ACK. Date: Fri, 05 Mar 1999 19:00:00 -0000 Message-id: <5md82njpam.fsf@jtc.redbacknetworks.com> X-SW-Source: 1999-03/msg00007.html The enclosed patch fixes a problem with m68k-stub.c, putpacket() only gave GDB one chance to receive the packet --- it did not wait until a ACK/NACK packet was received. Granted, the target will "hang" if the ACK or NACK is lost, but that's a deficiency in the protocol shared by all targets. IMO, it's better that the putpacket() implementation of all the sample stubs be the same. This change brings them closer together (the sh stub is the only one that currently implements run length compression). 1999-03-05 J.T. Conklin * m68k-stub.c (putpacket): Restore code so that packets are sent until an ACK is received. Index: m68k-stub.c =================================================================== RCS file: /usr/rback/release/tools-src/gdb/gdb/m68k-stub.c,v retrieving revision 1.2 diff -c -r1.2 m68k-stub.c *** m68k-stub.c 1998/12/03 19:55:51 1.2 --- m68k-stub.c 1999/03/06 02:50:29 *************** *** 588,610 **** char ch; /* $#. */ ! do { ! putDebugChar('$'); ! checksum = 0; ! count = 0; ! ! while (ch=buffer[count]) { ! putDebugChar(ch); ! checksum += ch; ! count += 1; ! } ! ! putDebugChar('#'); ! putDebugChar(hexchars[checksum >> 4]); ! putDebugChar(hexchars[checksum % 16]); ! } while (1 == 0); /* (getDebugChar() != '+'); */ ! } char remcomInBuffer[BUFMAX]; --- 588,612 ---- char ch; /* $#. */ ! do ! { ! putDebugChar('$'); ! checksum = 0; ! count = 0; ! ! while (ch=buffer[count]) ! { ! putDebugChar(ch); ! checksum += ch; ! count += 1; ! } ! ! putDebugChar('#'); ! putDebugChar(hexchars[checksum >> 4]); ! putDebugChar(hexchars[checksum % 16]); ! } ! while ((getDebugChar() & 0x7f) != '+'); } char remcomInBuffer[BUFMAX]; -- 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: m68k-stub.c patch, putpacket should wait for ACK. Date: Thu, 01 Apr 1999 00:00:00 -0000 Message-ID: <5md82njpam.fsf@jtc.redbacknetworks.com> X-SW-Source: 1999-q1/msg00061.html Message-ID: <19990401000000.3ClAWqHrED63SL3bxsOwkTJBDfdnts5kLTzeYiD9Fn8@z> The enclosed patch fixes a problem with m68k-stub.c, putpacket() only gave GDB one chance to receive the packet --- it did not wait until a ACK/NACK packet was received. Granted, the target will "hang" if the ACK or NACK is lost, but that's a deficiency in the protocol shared by all targets. IMO, it's better that the putpacket() implementation of all the sample stubs be the same. This change brings them closer together (the sh stub is the only one that currently implements run length compression). 1999-03-05 J.T. Conklin * m68k-stub.c (putpacket): Restore code so that packets are sent until an ACK is received. Index: m68k-stub.c =================================================================== RCS file: /usr/rback/release/tools-src/gdb/gdb/m68k-stub.c,v retrieving revision 1.2 diff -c -r1.2 m68k-stub.c *** m68k-stub.c 1998/12/03 19:55:51 1.2 --- m68k-stub.c 1999/03/06 02:50:29 *************** *** 588,610 **** char ch; /* $#. */ ! do { ! putDebugChar('$'); ! checksum = 0; ! count = 0; ! ! while (ch=buffer[count]) { ! putDebugChar(ch); ! checksum += ch; ! count += 1; ! } ! ! putDebugChar('#'); ! putDebugChar(hexchars[checksum >> 4]); ! putDebugChar(hexchars[checksum % 16]); ! } while (1 == 0); /* (getDebugChar() != '+'); */ ! } char remcomInBuffer[BUFMAX]; --- 588,612 ---- char ch; /* $#. */ ! do ! { ! putDebugChar('$'); ! checksum = 0; ! count = 0; ! ! while (ch=buffer[count]) ! { ! putDebugChar(ch); ! checksum += ch; ! count += 1; ! } ! ! putDebugChar('#'); ! putDebugChar(hexchars[checksum >> 4]); ! putDebugChar(hexchars[checksum % 16]); ! } ! while ((getDebugChar() & 0x7f) != '+'); } char remcomInBuffer[BUFMAX]; -- J.T. Conklin RedBack Networks