From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18141 invoked by alias); 7 Mar 2005 22:45:20 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 18127 invoked from network); 7 Mar 2005 22:45:17 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sourceware.org with SMTP; 7 Mar 2005 22:45:17 -0000 Received: from drow by nevyn.them.org with local (Exim 4.44 #1 (Debian)) id 1D8QyT-00038r-Dr; Mon, 07 Mar 2005 17:45:17 -0500 Date: Mon, 07 Mar 2005 22:45:00 -0000 From: Daniel Jacobowitz To: Nathan Sidwell Cc: gdb-patches@sources.redhat.com, Paul Brook Subject: Re: [PATCH] remote protocol cleanups Message-ID: <20050307224517.GB28725@nevyn.them.org> Mail-Followup-To: Nathan Sidwell , gdb-patches@sources.redhat.com, Paul Brook References: <4209F9CE.4030405@codesourcery.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4209F9CE.4030405@codesourcery.com> User-Agent: Mutt/1.5.6+20040907i X-SW-Source: 2005-03/txt/msg00105.txt.bz2 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