This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [PATCH] remote protocol cleanups
- From: Daniel Jacobowitz <drow at false dot org>
- To: Nathan Sidwell <nathan at codesourcery dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Tue, 8 Mar 2005 08:37:00 -0500
- Subject: Re: [PATCH] remote protocol cleanups
- References: <4209F9CE.4030405@codesourcery.com> <20050307224517.GB28725@nevyn.them.org> <422D87F3.9040804@codesourcery.com>
On Tue, Mar 08, 2005 at 11:09:39AM +0000, Nathan Sidwell wrote:
> Daniel Jacobowitz wrote:
> >On Wed, Feb 09, 2005 at 11:53:50AM +0000, Nathan Sidwell wrote:
>
> >>2) remote_write_bytes attempts to honour get_memory_write_packet_size's
> >>limit, but fails in two ways when that is a very small number. a) it can
> >>end up with a negative byte count. b) it deducts the number of chars in
> >>the *maximal* length count, not the number of chars in the actual length
> >>count. This can result in packets sending 1 or 2 bytes fewer than they
> >>are limited to.
>
> >
> >Mostly OK, but one question. I don't get the "max (todo, 1)". If no
> >bytes fit, aren't we hosed? It seems like an error condition; we
> >shouldn't be violating the size limit.
>
> It appears the minimum size setting is somewhat arbitrary, and incorrect.
> /* NOTE: 16 is just chosen at random. */
> #ifndef MIN_REMOTE_PACKET_SIZE
> #define MIN_REMOTE_PACKET_SIZE 16
> #endif
>
> the minumum packet size is actually
> 7 - strlen ("$M,:#NN")
> 8 - hexnumlen (memaddr) (32 bit host)
> 1 - hexnumlen (len)
> 2 - data
> = 18 characters
>
> This patch fixes that size calculation. ok?
Yes, this is OK.
--
Daniel Jacobowitz
CodeSourcery, LLC