* spu-linux-nat.c (spu_xfer_partial): Return -1 for unsupported
[deliverable/binutils-gdb.git] / gdb / spu-linux-nat.c
index fd3673c6a234a6c9eb1a066eea33c49a2584f1ae..7f71b585a006ab94e7e84b3f8282a6580855474b 100644 (file)
@@ -1,5 +1,5 @@
 /* SPU native-dependent code for GDB, the GNU debugger.
-   Copyright (C) 2006 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2007 Free Software Foundation, Inc.
 
    Contributed by Ulrich Weigand <uweigand@de.ibm.com>.
 
@@ -281,6 +281,18 @@ spu_bfd_iovec_pread (struct bfd *abfd, void *stream, void *buf,
   return nbytes;
 }
 
+static int
+spu_bfd_iovec_stat (struct bfd *abfd, void *stream, struct stat *sb)
+{
+  /* We don't have an easy way of finding the size of embedded spu
+     images.  We could parse the in-memory ELF header and section
+     table to find the extent of the last section but that seems
+     pointless when the size is needed only for checks of other
+     parsed values in dbxread.c.  */
+  sb->st_size = INT_MAX;
+  return 0;
+}
+
 static bfd *
 spu_bfd_open (CORE_ADDR addr)
 {
@@ -291,7 +303,8 @@ spu_bfd_open (CORE_ADDR addr)
 
   nbfd = bfd_openr_iovec (xstrdup ("<in-memory>"), "elf32-spu",
                          spu_bfd_iovec_open, open_closure,
-                         spu_bfd_iovec_pread, spu_bfd_iovec_close);
+                         spu_bfd_iovec_pread, spu_bfd_iovec_close,
+                         spu_bfd_iovec_stat);
   if (!nbfd)
     return NULL;
 
@@ -523,7 +536,7 @@ spu_xfer_partial (struct target_ops *ops,
       return spu_proc_xfer_spu (mem_annex, readbuf, writebuf, offset, len);
     }
 
-  return 0;
+  return -1;
 }
 
 /* Override the to_can_use_hw_breakpoint routine.  */
This page took 0.031807 seconds and 4 git commands to generate.