From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7348 invoked by alias); 6 Dec 2007 14:22:15 -0000 Received: (qmail 7332 invoked by uid 22791); 6 Dec 2007 14:22:14 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 06 Dec 2007 14:22:07 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 6AF1A982D9; Thu, 6 Dec 2007 14:22:06 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 52BB598150; Thu, 6 Dec 2007 14:22:06 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.68) (envelope-from ) id 1J0Hc5-0007gL-AM; Thu, 06 Dec 2007 09:22:05 -0500 Date: Thu, 06 Dec 2007 16:27:00 -0000 From: Daniel Jacobowitz To: Mick Davis Cc: gdb-patches@sourceware.org Subject: Re: gdbserver corrupts binary data in remote protocol Message-ID: <20071206142205.GA28845@caradoc.them.org> Mail-Followup-To: Mick Davis , gdb-patches@sourceware.org References: <475801C5.2090809@goanna.iinet.net.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <475801C5.2090809@goanna.iinet.net.au> User-Agent: Mutt/1.5.15 (2007-04-09) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-12/txt/msg00106.txt.bz2 On Thu, Dec 06, 2007 at 11:05:57PM +0900, Mick Davis wrote: > > I believe I've found a small bug when using the gdbserver to write into target > memory. > > If the command received by the server uses a binary encoded data part, the > remote protocol will clear the most significant bit of each byte. This may > result in a CRC failure. The fix is to the readchar function, which applies a > bit mask to the returned byte. How embarrassing. I thought I'd fixed this before so I went to check: it only happens when not reading from the cached buffer, since I fixed the other occurance and missed this one. Most packets fit in a single buffer when using TCP, and the first character in the packet never has its high bit set. > 2007-12-06 Mick Davis > > * gdbserver/remote-utils.c (readchar): Allow binary data in received messages I've checked this in for you. Thanks! -- Daniel Jacobowitz CodeSourcery