[rfc/rfa] [1/4] SPU enhancements: preparation

Daniel Jacobowitz drow@false.org
Mon Jun 4 19:27:00 GMT 2007


On Sat, Jun 02, 2007 at 09:31:11PM +0200, Ulrich Weigand wrote:
> Hello,
> 
> this is a small fix in preparation for adding extended SPU query support.
> Some files in spufs accessed via the spu_proc_xfer_spu routines in
> spu-linux-nat.c and gdbserver/spu-low.c are non-seekable.  Currently,
> any attempt to access those at non-zero offset results in a failure.
> 
> However, that is a problem when trying to use those files via the
> target object mechanism.  For example, the target_read routine will
> first read a chunk at offset zero (which succeeds, and in fact is
> generally sufficient to retrieve the full contents as the non-seekable
> files are small).  But then it attempts a second read at an offset
> corresponding to the length of the first chunk read, which now fails.
> 
> This patch changes spu_proc_xfer_spu to simply return zero (i.e. no
> more data available) on any attempt to access a non-seekable spufs
> file at non-zero offset.
> 
> Tested on spu-elf in conjunction with the other patches.

Seems reasonable to me.

-- 
Daniel Jacobowitz
CodeSourcery



More information about the Gdb-patches mailing list