From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12629 invoked by alias); 15 Jun 2004 08:21: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 12603 invoked from network); 15 Jun 2004 08:21:17 -0000 Received: from unknown (HELO gizmo01ps.bigpond.com) (144.140.71.11) by sourceware.org with SMTP; 15 Jun 2004 08:21:17 -0000 Received: (qmail 8023 invoked from network); 15 Jun 2004 07:08:46 -0000 Received: from unknown (HELO psmam01.bigpond.com) (144.135.25.69) by gizmo01ps.bigpond.com with SMTP; 15 Jun 2004 07:08:46 -0000 Received: from cpe-203-51-247-11.qld.bigpond.net.au ([203.51.247.11]) by psmam01.bigpond.com(MAM REL_3_4_2a 65/15708308) with SMTP id 15708308; Tue, 15 Jun 2004 18:21:11 +1000 Message-ID: <40CEB176.1040904@neurizon.net> Date: Tue, 15 Jun 2004 08:21:00 -0000 From: Steven Johnson User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.6) Gecko/20040115 MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: Small problem with Remote Protocol register fetching. Content-Type: multipart/mixed; boundary="------------020901000300000203050502" X-SW-Source: 2004-06/txt/msg00346.txt.bz2 This is a multi-part message in MIME format. --------------020901000300000203050502 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 688 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 --------------020901000300000203050502 Content-Type: text/x-patch; name="gdb-6.1-rsp-hexencodecasecheck.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="gdb-6.1-rsp-hexencodecasecheck.patch" Content-length: 625 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) --------------020901000300000203050502--