From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5884 invoked by alias); 15 Jun 2004 18:52:28 -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 5877 invoked from network); 15 Jun 2004 18:52:27 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 15 Jun 2004 18:52:27 -0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i5FIqRe1015945 for ; Tue, 15 Jun 2004 14:52:27 -0400 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx2.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i5FIqQw20201; Tue, 15 Jun 2004 14:52:26 -0400 Received: from redhat.com (dhcp-172-16-25-160.sfbay.redhat.com [172.16.25.160]) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id i5FIqPP23133; Tue, 15 Jun 2004 11:52:25 -0700 Message-ID: <40CF4569.3000404@redhat.com> Date: Tue, 15 Jun 2004 18:52:00 -0000 From: Michael Snyder Organization: Red Hat, Inc. User-Agent: Mozilla/5.0 (X11; U; Linux i686; es-ES; rv:1.4.2) Gecko/20040301 MIME-Version: 1.0 To: Steven Johnson CC: gdb-patches@sources.redhat.com Subject: Re: Small problem with Remote Protocol register fetching. References: <40CEB176.1040904@neurizon.net> In-Reply-To: <40CEB176.1040904@neurizon.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-06/txt/msg00355.txt.bz2 Steven Johnson wrote: > Registers in the remote protocol are Hex Encoded. Hex encoded values > can have (as far as I can tell, valid values of '0'-'9','a'-'f','A'-'F' > and ('x' for registers). the problem is that register packets that have > an upper case 'A'-'F' in the first location are junked as being bad > packets, when their is nothing wrong. And then GDB ends up in an > infinite comms loop, trying to recover. > > The attached patch allows Hex Encoded values to include upper case > letters (in the case of fetching registers) without causing the packet > handling to fail. > > I wasnt sure if 'X' should also be allowable, seems like it should, but > i dont know for sure, so havent changed it. > > Steven Johnson What Andrew said, but OTOH, this is certainly not an intrusive change. Steven, what remote target are you seeing this with? [Someone will say "but then we'll have to make sure that we consistantly accept upper case throughout, and I agree that's a little more intrusive] > ------------------------------------------------------------------------ > > diff -p -u -r clean-src/insight-6.1/gdb/frame.c mod-src/insight-6.1/gdb/frame.c > diff -p -u -r clean-src/insight-6.1/gdb/remote.c mod-src/insight-6.1/gdb/remote.c > --- clean-src/insight-6.1/gdb/remote.c 2004-02-26 06:41:00.000000000 +1000 > +++ mod-src/insight-6.1/gdb/remote.c 2004-06-15 16:36:53.000000000 +1000 > @@ -3278,6 +3278,7 @@ remote_fetch_registers (int regnum) > and try to fetch another packet to read. */ > while ((buf[0] < '0' || buf[0] > '9') > && (buf[0] < 'a' || buf[0] > 'f') > + && (buf[0] < 'A' || buf[0] > 'F') > && buf[0] != 'x') /* New: unavailable register value */ > { > if (remote_debug)