From patchwork Wed May 4 23:45:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulrich Weigand X-Patchwork-Id: 12016 Received: (qmail 27201 invoked by alias); 4 May 2016 23:45:35 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 27191 invoked by uid 89); 4 May 2016 23:45:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.0 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=H*r:500, 1097, 1098, Cast X-HELO: e06smtp14.uk.ibm.com Received: from e06smtp14.uk.ibm.com (HELO e06smtp14.uk.ibm.com) (195.75.94.110) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Wed, 04 May 2016 23:45:32 +0000 Received: from localhost by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 5 May 2016 00:45:28 +0100 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 5 May 2016 00:45:27 +0100 X-IBM-Helo: d06dlp02.portsmouth.uk.ibm.com X-IBM-MailFrom: uweigand@de.ibm.com X-IBM-RcptTo: gdb-patches@sourceware.org Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 33DC9219004D for ; Thu, 5 May 2016 00:45:03 +0100 (BST) Received: from d06av06.portsmouth.uk.ibm.com (d06av06.portsmouth.uk.ibm.com [9.149.37.217]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u44NjQwQ8716718 for ; Wed, 4 May 2016 23:45:26 GMT Received: from d06av06.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av06.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u44NjQQn028553 for ; Wed, 4 May 2016 19:45:26 -0400 Received: from oc7340732750.ibm.com (icon-9-167-242-237.megacenter.de.ibm.com [9.167.242.237]) by d06av06.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u44NjQvZ028550 for ; Wed, 4 May 2016 19:45:26 -0400 Received: by oc7340732750.ibm.com (Postfix, from userid 500) id CF15F7783; Wed, 4 May 2016 19:45:20 -0400 (EDT) Subject: [pushed][spu] Fix C++ build problems To: gdb-patches@sourceware.org Date: Wed, 4 May 2016 19:45:20 -0400 (EDT) From: "Ulrich Weigand" MIME-Version: 1.0 Message-Id: <20160504234520.CF15F7783@oc7340732750.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16050423-0017-0000-0000-00001D5614F8 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. diff --git a/gdb/gdbserver/spu-low.c b/gdb/gdbserver/spu-low.c index 5b54546..32e7c72 100644 --- a/gdb/gdbserver/spu-low.c +++ b/gdb/gdbserver/spu-low.c @@ -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 diff --git a/gdb/spu-linux-nat.c b/gdb/spu-linux-nat.c index 8d4dee3..f1d58ec 100644 --- a/gdb/spu-linux-nat.c +++ b/gdb/spu-linux-nat.c @@ -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';