This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: gdbserver corrupts binary data in remote protocol
- From: Daniel Jacobowitz <drow at false dot org>
- To: Mick Davis <mickd at goanna dot iinet dot net dot au>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 6 Dec 2007 09:22:05 -0500
- Subject: Re: gdbserver corrupts binary data in remote protocol
- References: <475801C5.2090809@goanna.iinet.net.au>
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 <mickd@goanna.iinet.net.au>
>
> * gdbserver/remote-utils.c (readchar): Allow binary data in received messages
I've checked this in for you. Thanks!
--
Daniel Jacobowitz
CodeSourcery