From patchwork Thu Apr 21 11:11:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 11832 Received: (qmail 32979 invoked by alias); 21 Apr 2016 11:11:21 -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 32965 invoked by uid 89); 21 Apr 2016 11:11:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=psw, PSW X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 21 Apr 2016 11:11:19 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F1EE61A0EDF for ; Thu, 21 Apr 2016 11:11:17 +0000 (UTC) Received: from cascais.lan (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u3LBBGAM006498 for ; Thu, 21 Apr 2016 07:11:17 -0400 From: Pedro Alves To: gdb-patches@sourceware.org Subject: [pushed] Fix s390 GNU/Linux gdb and gdbserver builds Date: Thu, 21 Apr 2016 12:11:16 +0100 Message-Id: <1461237076-30696-1-git-send-email-palves@redhat.com> MIME-Version: 1.0 Now that gdb/gdbserver compile as C++ programs by default, the s390 GNU/Linux build started failing with: In file included from ../../src/gdb/common/common-defs.h:64:0, from ../../src/gdb/defs.h:28, from ../../src/gdb/s390-linux-nat.c:22: ../../src/gdb/s390-linux-nat.c: In function ‘void fetch_regset(regcache*, int, int, int, const regset*)’: ../../src/gdb/../include/libiberty.h:711:38: error: invalid conversion from ‘void*’ to ‘gdb_byte* {aka unsigned char*}’ [-fpermissive] # define alloca(x) __builtin_alloca(x) ^ ../../src/gdb/s390-linux-nat.c:297:19: note: in expansion of macro ‘alloca’ gdb_byte *buf = alloca (regsize); ^ etc. gdb/ChangeLog: 2016-04-21 Pedro Alves * s390-linux-nat.c (fetch_regset, store_regset, check_regset): Use void * instead of gdb_byte *. gdb/gdbserver/ChangeLog: 2016-04-21 Pedro Alves * linux-s390-low.c (s390_collect_ptrace_register) (s390_supply_ptrace_register, s390_get_hwcap): Use gdb_byte * and add casts. (s390_check_regset): Use void * instead of gdb_byte *. --- gdb/ChangeLog | 5 +++++ gdb/gdbserver/ChangeLog | 7 +++++++ gdb/gdbserver/linux-s390-low.c | 12 ++++++------ gdb/s390-linux-nat.c | 6 +++--- 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f16912c..0741d1c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2016-04-21 Pedro Alves + * s390-linux-nat.c (fetch_regset, store_regset, check_regset): Use + void * instead of gdb_byte *. + +2016-04-21 Pedro Alves + * dwarf2read.c (try_open_dwop_file, open_dwo_file) (file_file_name, file_full_name): Add char * cast to sentinel in concat/reconcat calls. diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 029205d..db76e1a 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,10 @@ +2016-04-21 Pedro Alves + + * linux-s390-low.c (s390_collect_ptrace_register) + (s390_supply_ptrace_register, s390_get_hwcap): Use gdb_byte * and + add casts. + (s390_check_regset): Use void * instead of gdb_byte *. + 2016-04-20 Pedro Alves * configure: Renegerate. diff --git a/gdb/gdbserver/linux-s390-low.c b/gdb/gdbserver/linux-s390-low.c index 12269b6..f5a7d85 100644 --- a/gdb/gdbserver/linux-s390-low.c +++ b/gdb/gdbserver/linux-s390-low.c @@ -171,7 +171,7 @@ s390_collect_ptrace_register (struct regcache *regcache, int regno, char *buf) { /* Convert 4-byte PSW mask to 8 bytes by clearing bit 12 and copying the basic addressing mode bit from the PSW address. */ - char *addr = alloca (register_size (regcache->tdesc, regno ^ 1)); + gdb_byte *addr = (gdb_byte *) alloca (register_size (regcache->tdesc, regno ^ 1)); collect_register (regcache, regno, buf); collect_register (regcache, regno ^ 1, addr); buf[1] &= ~0x8; @@ -216,8 +216,8 @@ s390_supply_ptrace_register (struct regcache *regcache, { /* Convert 8-byte PSW mask to 4 bytes by setting bit 12 and copying the basic addressing mode into the PSW address. */ - char *mask = alloca (size); - char *addr = alloca (register_size (regcache->tdesc, regno ^ 1)); + gdb_byte *mask = (gdb_byte *) alloca (size); + gdb_byte *addr = (gdb_byte *) alloca (register_size (regcache->tdesc, regno ^ 1)); memcpy (mask, buf, size); mask[1] |= 0x8; supply_register (regcache, regno, mask); @@ -231,7 +231,7 @@ s390_supply_ptrace_register (struct regcache *regcache, { /* Convert 8-byte PSW address to 4 bytes by truncating, but keeping the addressing mode bit (which was set from the mask). */ - char *addr = alloca (size); + gdb_byte *addr = (gdb_byte *) alloca (size); char amode; collect_register (regcache, regno, addr); amode = addr[0] & 0x80; @@ -442,7 +442,7 @@ static unsigned long s390_get_hwcap (const struct target_desc *tdesc) { int wordsize = register_size (tdesc, 0); - unsigned char *data = alloca (2 * wordsize); + gdb_byte *data = (gdb_byte *) alloca (2 * wordsize); int offset = 0; while ((*the_target->read_auxv) (offset, data, 2 * wordsize) == 2 * wordsize) @@ -469,7 +469,7 @@ s390_get_hwcap (const struct target_desc *tdesc) static int s390_check_regset (int pid, int regset, int regsize) { - gdb_byte *buf = alloca (regsize); + void *buf = alloca (regsize); struct iovec iov; iov.iov_base = buf; diff --git a/gdb/s390-linux-nat.c b/gdb/s390-linux-nat.c index ae0e2c6..e91297b 100644 --- a/gdb/s390-linux-nat.c +++ b/gdb/s390-linux-nat.c @@ -294,7 +294,7 @@ static void fetch_regset (struct regcache *regcache, int tid, int regset_id, int regsize, const struct regset *regset) { - gdb_byte *buf = alloca (regsize); + void *buf = alloca (regsize); struct iovec iov; iov.iov_base = buf; @@ -318,7 +318,7 @@ static void store_regset (struct regcache *regcache, int tid, int regset_id, int regsize, const struct regset *regset) { - gdb_byte *buf = alloca (regsize); + void *buf = alloca (regsize); struct iovec iov; iov.iov_base = buf; @@ -338,7 +338,7 @@ store_regset (struct regcache *regcache, int tid, static int check_regset (int tid, int regset, int regsize) { - gdb_byte *buf = alloca (regsize); + void *buf = alloca (regsize); struct iovec iov; iov.iov_base = buf;