This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
Re: Change stubs to handle '$' after packet start
- To: jtc@redback.com
- Subject: Re: Change stubs to handle '$' after packet start
- From: Stan Shebs <shebs@cygnus.com>
- Date: Wed, 25 Aug 1999 18:10:42 -0700
- CC: gdb-patches@sourceware.cygnus.com
From: jtc@redback.com (J.T. Conklin)
Date: 19 Aug 1999 20:04:42 -0700
jtc> This change adds code in getpacket() to start a new packet if
jtc> the packet start character ('$') is received while reading
jtc> the packet contents. This prevents the loss of the
jtc> subsequent packet if the packet end character '#' is
jtc> lost/garbled.
Stan> The change is innocuous, but is it really useful?
I think so. I suspect serial packet protocols which have both begin
and end packet characters do the same thing. I checked SL/IP, but
that only uses a single begin (or end, depending on your point of
view) character for packet framing.
OK, I buy your argument. It would be nice to have a place for your
explanation, ideally in the part of the GDB manual that explains how
to write stubs.
As for letting the user know something is wrong. Unfortunately, there
is no good way to indicate to the user that a stub is losing packets.
We could add a debug_error() call there on those stubs that support
that function. We could also add some standard statistics variables
that could be queried by GDB (number of packets received, number of
packets sent, number of retries, etc.). It would be easy enough to
add the same sorts of counters on the GDB side, which is almost the
same thing.
That would a useful bit of statistic...
Stan