breakpoint extension for remote protocol, take II

Andrew Cagney
Tue Jun 22 18:46:00 GMT 1999

"J.T. Conklin" wrote:
> However, there is still one problem with my proposal which I have not
> had time to address.  As the remote protocol is a datagram protocol
> and the breakpoint extension adds run-time state to the stub, there
> must be some mechanism to handle dropped and duplicate packets.
> Perhaps a sequence number argument needs to be added to the command
> and the response.
>         Zseq,t,AA..AA,LLLL
>         OK<seq>
>         ERR<seq>
> The same sequence number scheme could be used for this, and any other
> stateful commands that might be added in the future.

(correct, dropped, duplicate, re-ordered)


Another undocumented feature of a typical stub is that it can have a
sequence number:

	``$'' <seq> <seq> ``:'' <packet>

ex:	<- $23:Z,0,1234,2
	-> +23

Look for the code:

    void getpacket(buffer)
      if (checksum != xmitcsum) putDebugChar('-');  /* failed checksum
      else {
         putDebugChar('+');  /* successful transfer */
         /* if a sequence char is present, reply the sequence ID */
         if (buffer[2] == ':') {

Mind you I don't know that it helps.  The stub doesn't do anything with
the sequence number apart from send it straight back.  It doesn't, for
instance discard a duplicate.


PS: Perhaphs I should cut/paste the layering comment you made (from
QBaud) here :-)

More information about the Gdb mailing list