[ARC] Add checking for LP_COUNT reg usage, improve error reporting.
[deliverable/binutils-gdb.git] / gdb / spu-linux-nat.c
index 71c1643c550b771e094d357eb5e2159a2e2df5b6..f1d58ec3a2dee656683564c04c685ad16724ee82 100644 (file)
@@ -1,5 +1,5 @@
 /* SPU native-dependent code for GDB, the GNU debugger.
-   Copyright (C) 2006-2014 Free Software Foundation, Inc.
+   Copyright (C) 2006-2016 Free Software Foundation, Inc.
 
    Contributed by Ulrich Weigand <uweigand@de.ibm.com>.
 
@@ -20,7 +20,6 @@
 
 #include "defs.h"
 #include "gdbcore.h"
-#include <string.h>
 #include "target.h"
 #include "inferior.h"
 #include "inf-child.h"
@@ -31,7 +30,7 @@
 #include "gdbthread.h"
 #include "gdb_bfd.h"
 
-#include <sys/ptrace.h>
+#include "nat/gdb_ptrace.h"
 #include <asm/ptrace.h>
 #include <sys/types.h>
 
@@ -297,7 +296,7 @@ spu_bfd_iovec_pread (struct bfd *abfd, void *stream, void *buf,
 {
   ULONGEST addr = *(ULONGEST *)stream;
 
-  if (fetch_ppc_memory (addr + offset, buf, nbytes) != 0)
+  if (fetch_ppc_memory (addr + offset, (gdb_byte *)buf, nbytes) != 0)
     {
       bfd_set_error (bfd_error_invalid_operation);
       return -1;
@@ -314,6 +313,7 @@ spu_bfd_iovec_stat (struct bfd *abfd, void *stream, struct stat *sb)
      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.  */
+  memset (sb, 0, sizeof (struct stat));
   sb->st_size = INT_MAX;
   return 0;
 }
@@ -324,7 +324,7 @@ spu_bfd_open (ULONGEST addr)
   struct bfd *nbfd;
   asection *spu_name;
 
-  ULONGEST *open_closure = xmalloc (sizeof (ULONGEST));
+  ULONGEST *open_closure = XNEW (ULONGEST);
   *open_closure = addr;
 
   nbfd = gdb_bfd_openr_iovec ("<in-memory>", "elf32-spu",
@@ -347,7 +347,7 @@ spu_bfd_open (ULONGEST addr)
       int sect_size = bfd_section_size (nbfd, spu_name);
       if (sect_size > 20)
        {
-         char *buf = alloca (sect_size - 20 + 1);
+         char *buf = (char *)alloca (sect_size - 20 + 1);
          bfd_get_section_contents (nbfd, spu_name, buf, 20, sect_size - 20);
          buf[sect_size - 20] = '\0';
 
@@ -401,7 +401,7 @@ spu_symbol_file_add_from_memory (int inferior_fd)
 /* Override the post_startup_inferior routine to continue running
    the inferior until the first spu_run system call.  */
 static void
-spu_child_post_startup_inferior (ptid_t ptid)
+spu_child_post_startup_inferior (struct target_ops *self, ptid_t ptid)
 {
   int fd;
   ULONGEST addr;
@@ -624,7 +624,8 @@ spu_xfer_partial (struct target_ops *ops,
 
 /* Override the to_can_use_hw_breakpoint routine.  */
 static int
-spu_can_use_hw_breakpoint (int type, int cnt, int othertype)
+spu_can_use_hw_breakpoint (struct target_ops *self,
+                          enum bptype type, int cnt, int othertype)
 {
   return 0;
 }
This page took 0.025482 seconds and 4 git commands to generate.