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, Paul Brook <paul at codesourcery dot com>
- Date: Mon, 7 Mar 2005 17:45:17 -0500
- Subject: Re: [PATCH] remote protocol cleanups
- References: <4209F9CE.4030405@codesourcery.com>
On Wed, Feb 09, 2005 at 11:53:50AM +0000, Nathan Sidwell wrote:
> Hi,
> This patch fixes a couple of problems with the remote protcol handling
>
> 1) remote_fetch_registers checks to see things have not got out of
> sync, but it does not deal with upper case hex characters and so can get
> confused
>
> 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.
>
> built & tested on i686-pc-linux-gnu and an unreleased architecture. ok?
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.
> case PACKET_DISABLE:
> *p++ = 'M';
> /* Num bytes that will fit. */
> todo = min (len, payload_size / 2);
> + payload_size -= hexnumlen (todo);
> + todo = min (todo, payload_size / 2);
> + todo = max (todo, 1);
> break;
> case PACKET_SUPPORT_UNKNOWN:
> internal_error (__FILE__, __LINE__,
--
Daniel Jacobowitz
CodeSourcery, LLC