[spu] Fix C++ build problems
authorUlrich Weigand <ulrich.weigand@de.ibm.com>
Wed, 4 May 2016 23:42:09 +0000 (19:42 -0400)
committerUlrich Weigand <ulrich.weigand@de.ibm.com>
Wed, 4 May 2016 23:42:09 +0000 (19:42 -0400)
ChangeLog:

* spu-linux-nat.c (spu_bfd_iovec_pread): Add pointer cast for C++.
(spu_bfd_open): Likewise.

gdbserver/ChangeLog:

* spu-low.c (fetch_ppc_register): Cast PowerPC-Linux-specific value
used as first ptrace argument to PTRACE_TYPE_ARG1 for C++.
(fetch_ppc_memory_1, store_ppc_memory_1): Likewise.

gdb/ChangeLog
gdb/gdbserver/ChangeLog
gdb/gdbserver/spu-low.c
gdb/spu-linux-nat.c

index 8f1b4a48927d928c48a8fbd2773d472f2e52e139..2afa2f57160ecd81985f3db55a992dd99d9733e1 100644 (file)
@@ -1,3 +1,8 @@
+2016-05-04  Ulrich Weigand  <uweigand@de.ibm.com>
+
+       * spu-linux-nat.c (spu_bfd_iovec_pread): Add pointer cast for C++.
+       (spu_bfd_open): Likewise.
+
 2016-05-04  Yao Qi  <yao.qi@linaro.org>
 
        PR gdb/19947
index a0c90ee0a7ce5f4658dbe5d0e4e160c933d9fa9a..b6748327fe670b7844f3db89dc7072d12391fdcf 100644 (file)
@@ -1,3 +1,9 @@
+2016-05-04  Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+       * spu-low.c (fetch_ppc_register): Cast PowerPC-Linux-specific value
+       used as first ptrace argument to PTRACE_TYPE_ARG1 for C++.
+       (fetch_ppc_memory_1, store_ppc_memory_1): Likewise.
+
 2016-04-28  Par Olsson  <par.olsson@windriver.com>
 2016-04-28  Simon Marchi  <simon.marchi@ericsson.com>
 
index 5b545464e799cf1feed267275cee23fd20ad29d0..32e7c72cd10f2fe265e79c84f9910129b2ff0e48 100644 (file)
@@ -76,10 +76,10 @@ fetch_ppc_register (int regno)
     char buf[8];
 
     errno = 0;
-    ptrace (PPC_PTRACE_PEEKUSR_3264, tid,
+    ptrace ((PTRACE_TYPE_ARG1) PPC_PTRACE_PEEKUSR_3264, tid,
            (PTRACE_TYPE_ARG3) (regno * 8), buf);
     if (errno == 0)
-      ptrace (PPC_PTRACE_PEEKUSR_3264, tid,
+      ptrace ((PTRACE_TYPE_ARG1) PPC_PTRACE_PEEKUSR_3264, tid,
              (PTRACE_TYPE_ARG3) (regno * 8 + 4), buf + 4);
     if (errno == 0)
       return (CORE_ADDR) *(unsigned long long *)buf;
@@ -109,7 +109,8 @@ fetch_ppc_memory_1 (int tid, CORE_ADDR memaddr, PTRACE_TYPE_RET *word)
   if (memaddr >> 32)
     {
       unsigned long long addr_8 = (unsigned long long) memaddr;
-      ptrace (PPC_PTRACE_PEEKTEXT_3264, tid, (PTRACE_TYPE_ARG3) &addr_8, word);
+      ptrace ((PTRACE_TYPE_ARG1) PPC_PTRACE_PEEKTEXT_3264, tid,
+             (PTRACE_TYPE_ARG3) &addr_8, word);
     }
   else
 #endif
@@ -128,7 +129,8 @@ store_ppc_memory_1 (int tid, CORE_ADDR memaddr, PTRACE_TYPE_RET word)
   if (memaddr >> 32)
     {
       unsigned long long addr_8 = (unsigned long long) memaddr;
-      ptrace (PPC_PTRACE_POKEDATA_3264, tid, (PTRACE_TYPE_ARG3) &addr_8, word);
+      ptrace ((PTRACE_TYPE_ARG1) PPC_PTRACE_POKEDATA_3264, tid,
+             (PTRACE_TYPE_ARG3) &addr_8, word);
     }
   else
 #endif
index 8d4dee3f469e9704a4d718782e40124822119484..f1d58ec3a2dee656683564c04c685ad16724ee82 100644 (file)
@@ -296,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;
@@ -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';
 
This page took 0.057946 seconds and 4 git commands to generate.