From patchwork Sun Oct 11 04:37:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 9041 Received: (qmail 111312 invoked by alias); 11 Oct 2015 04:37:34 -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 111014 invoked by uid 89); 11 Oct 2015 04:37:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL, BAYES_00, SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: smtp.electronicbox.net Received: from smtp.electronicbox.net (HELO smtp.electronicbox.net) (96.127.255.83) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 11 Oct 2015 04:37:21 +0000 Received: from simark.lan. (cable-192.222.137.139.electronicbox.net [192.222.137.139]) by smtp.electronicbox.net (Postfix) with ESMTP id 0AE95440E7B; Sun, 11 Oct 2015 00:37:20 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH c++ 4/5] mips: fix void*/gdb_byte* compilation errors Date: Sun, 11 Oct 2015 00:37:17 -0400 Message-Id: <1444538238-7468-4-git-send-email-simon.marchi@polymtl.ca> In-Reply-To: <1444538238-7468-1-git-send-email-simon.marchi@polymtl.ca> References: <1444538238-7468-1-git-send-email-simon.marchi@polymtl.ca> The error in mips64_linux_get_longjmp_target is fixed by changing "buf" to be a gdb_byte*, as usual. supply_32bit_reg and mips64_fill_gregset do some more complicated things however, so it's safer just to add the explicit cast and avoid changing the code too much. gdb/ChangeLog: * mips-linux-tdep.c (mips64_linux_get_longjmp_target): Change type of buf to gdb_byte*. (supply_32bit_reg): Add cast. (mips64_fill_gregset): Likewise. --- gdb/mips-linux-tdep.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gdb/mips-linux-tdep.c b/gdb/mips-linux-tdep.c index a8c86bb..f7eaf34 100644 --- a/gdb/mips-linux-tdep.c +++ b/gdb/mips-linux-tdep.c @@ -120,7 +120,8 @@ supply_32bit_reg (struct regcache *regcache, int regnum, const void *addr) enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); gdb_byte buf[MAX_REGISTER_SIZE]; store_signed_integer (buf, register_size (gdbarch, regnum), byte_order, - extract_signed_integer (addr, 4, byte_order)); + extract_signed_integer ((const gdb_byte *) addr, 4, + byte_order)); regcache_raw_supply (regcache, regnum, buf); } @@ -334,7 +335,8 @@ mips64_linux_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc) CORE_ADDR jb_addr; struct gdbarch *gdbarch = get_frame_arch (frame); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - void *buf = alloca (gdbarch_ptr_bit (gdbarch) / TARGET_CHAR_BIT); + gdb_byte *buf + = (gdb_byte *) alloca (gdbarch_ptr_bit (gdbarch) / TARGET_CHAR_BIT); int element_size = gdbarch_ptr_bit (gdbarch) == 32 ? 4 : 8; jb_addr = get_frame_register_unsigned (frame, MIPS_A0_REGNUM); @@ -475,7 +477,7 @@ mips64_fill_gregset (const struct regcache *regcache, val = extract_signed_integer (buf, register_size (gdbarch, regno), byte_order); dst = regp + regaddr; - store_signed_integer (dst, 8, byte_order, val); + store_signed_integer ((gdb_byte *) dst, 8, byte_order, val); } }