Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@polymtl.ca>
Subject: [PATCH c++ 4/5] mips: fix void*/gdb_byte* compilation errors
Date: Sun, 11 Oct 2015 04:37:00 -0000	[thread overview]
Message-ID: <1444538238-7468-4-git-send-email-simon.marchi@polymtl.ca> (raw)
In-Reply-To: <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);
     }
 }
 
-- 
2.6.1


  reply	other threads:[~2015-10-11  4:37 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-11  4:37 [PATCH c++ 1/5] lm32: Add (const gdb_byte *) cast Simon Marchi
2015-10-11  4:37 ` Simon Marchi [this message]
2015-10-22 13:13   ` [PATCH c++ 4/5] mips: fix void*/gdb_byte* compilation errors Pedro Alves
2015-10-11  4:37 ` [PATCH c++ 3/5] mep: Add cast for int to enum conversion Simon Marchi
2015-10-12 10:35   ` Yao Qi
2015-10-12 16:43     ` Simon Marchi
2015-10-11  4:37 ` [PATCH c++ 2/5] m32c: Split m32c_move_reg_t in read/write variants Simon Marchi
2015-10-12 10:47   ` Yao Qi
2015-10-12 16:42     ` Simon Marchi
2015-10-11  4:44 ` [PATCH c++ 5/5] mips: Add cast for int to enum conversion Simon Marchi
2015-10-12 10:54   ` Pedro Alves
2015-10-12 16:28     ` Simon Marchi
2015-10-12 10:52 ` [PATCH c++ 1/5] lm32: Add (const gdb_byte *) cast Yao Qi
2015-10-12 11:10 ` Pedro Alves
2015-10-12 12:18   ` Jon Beniston
2015-10-13 17:14   ` Simon Marchi
2015-10-13 17:32     ` Pedro Alves
2015-10-13 17:37       ` Simon Marchi
2015-10-22  9:59 ` Simon Marchi
2015-10-22 13:34   ` Pedro Alves
2015-10-22 13:39     ` Simon Marchi
2015-10-22 15:21   ` Simon Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1444538238-7468-4-git-send-email-simon.marchi@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox