From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13848 invoked by alias); 4 Jun 2007 19:54:20 -0000 Received: (qmail 13840 invoked by uid 22791); 4 Jun 2007 19:54:20 -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; Mon, 04 Jun 2007 19:54:18 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 426C1982E4; Mon, 4 Jun 2007 19:54:16 +0000 (GMT) Received: from caradoc.them.org (dsl093-172-095.pit1.dsl.speakeasy.net [66.93.172.95]) by nan.false.org (Postfix) with ESMTP id C99E1982E2; Mon, 4 Jun 2007 19:54:15 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.67) (envelope-from ) id 1HvIcf-0006T1-G2; Mon, 04 Jun 2007 15:53:49 -0400 Date: Mon, 04 Jun 2007 19:54:00 -0000 From: Daniel Jacobowitz To: Ulrich Weigand Cc: gdb-patches@sourceware.org, eliz@gnu.org Subject: Re: [rfc/rfa] [3/4] SPU enhancements: gdbserver support Message-ID: <20070604195349.GC23516@caradoc.them.org> Mail-Followup-To: Ulrich Weigand , gdb-patches@sourceware.org, eliz@gnu.org References: <200706021933.l52JXTJX005551@d12av02.megacenter.de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200706021933.l52JXTJX005551@d12av02.megacenter.de.ibm.com> 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-06/txt/msg00038.txt.bz2 On Sat, Jun 02, 2007 at 09:33:29PM +0200, Ulrich Weigand wrote: > Hello, > > this patch, implemented by Markus Deuling, extends TARGET_OBJECT_SPU > support to remote gdbserver debugging. > > This is done by extended the remote protocol by two new packet types, > qXfer:spu:read and qXfer:spu:write. In addition, the patch contains > the following changes to remote packet support: The TARGET_OBJECT_SPU support looks fine. I don't really like either of these changes, though. > - It adds a "length" argument to qXfer::write type packets. This is > to make parsing of the packet easier, and to bring it in line with > the 'X' packet format. (It also provides a bit of extra redundancy > to detect transmission problems.) It adds another case that stubs need to check for (length != length of supplied data), and it's redundant. I have some code already written to generate and parse binary packets without a specified length, if you'd like me to post it. It's for the project I'm going to submit once I finish with shared library lists - file transfer through gdbserver. I think more redundancy is not what we need in an already chatty protocol :-) And anyone using this to debug an SPU is probably going to do so over a reliable link (pipe or TCP socket). > - The remote_read_qxfer attempts to cache received end-of-object > packets. However, this is a problem for some spufs objects as > they can start out with no content (length zero), and acquire > actual content later on. If remote_read_qxfer has already cache > an end-of-object at lenght zero, future re-reads of the object > will always return zero even if the object by now has actual > content. To fix this we've added a CACHEABLE flag to the > function and use it to disable the cache for spufs objects. How about this simpler fix? - if (rs->buf[0] == 'l') + if (rs->buf[0] == 'l' && offset + i > 0) It's only supposed to trigger for the next part of the same read operation. If we got no bytes, then the operation is already over. -- Daniel Jacobowitz CodeSourcery