From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5966 invoked by alias); 2 Jun 2007 19:31:18 -0000 Received: (qmail 5958 invoked by uid 22791); 2 Jun 2007 19:31:17 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate4.de.ibm.com (HELO mtagate4.de.ibm.com) (195.212.29.153) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 02 Jun 2007 19:31:15 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate4.de.ibm.com (8.13.8/8.13.8) with ESMTP id l52JVBdn178014 for ; Sat, 2 Jun 2007 19:31:11 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v8.3) with ESMTP id l52JVB8m1773674 for ; Sat, 2 Jun 2007 21:31:11 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l52JVB2I005087 for ; Sat, 2 Jun 2007 21:31:11 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id l52JVBZQ005084 for ; Sat, 2 Jun 2007 21:31:11 +0200 Message-Id: <200706021931.l52JVBZQ005084@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Sat, 2 Jun 2007 21:31:11 +0200 Subject: [rfc/rfa] [1/4] SPU enhancements: preparation To: gdb-patches@sourceware.org Date: Sat, 02 Jun 2007 19:31:00 -0000 From: "Ulrich Weigand" X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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/msg00017.txt.bz2 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. Bye, Ulrich ChangeLog: * spu-linux-nat.c (spu_proc_xfer_spu): Do not return failure when accessing non-seekable spufs files. gdbserver/ChangeLog: * spu-low.c (spu_proc_xfer_spu): Do not return failure when accessing non-seekable spufs files. diff -urNp gdb-orig/gdb/gdbserver/spu-low.c gdb-head/gdb/gdbserver/spu-low.c --- gdb-orig/gdb/gdbserver/spu-low.c 2007-05-10 23:34:34.000000000 +0200 +++ gdb-head/gdb/gdbserver/spu-low.c 2007-06-01 19:21:10.212694495 +0200 @@ -248,7 +248,7 @@ spu_proc_xfer_spu (const char *annex, un && lseek (fd, (off_t) offset, SEEK_SET) != (off_t) offset) { close (fd); - return -1; + return 0; } if (writebuf) diff -urNp gdb-orig/gdb/spu-linux-nat.c gdb-head/gdb/spu-linux-nat.c --- gdb-orig/gdb/spu-linux-nat.c 2007-05-09 01:01:49.000000000 +0200 +++ gdb-head/gdb/spu-linux-nat.c 2007-06-01 19:21:10.362672892 +0200 @@ -250,7 +250,7 @@ spu_proc_xfer_spu (const char *annex, gd && lseek (fd, (off_t) offset, SEEK_SET) != (off_t) offset) { close (fd); - return -1; + return 0; } if (writebuf) -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com