This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] gdbserver arm: Add casts
- From: Simon Marchi <simark at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 3 Nov 2015 18:35:05 -0000
- Subject: [binutils-gdb] gdbserver arm: Add casts
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=04248ead1f57204119180022580626e31c165f60
commit 04248ead1f57204119180022580626e31c165f60
Author: Simon Marchi <simon.marchi@polymtl.ca>
Date: Tue Nov 3 13:33:13 2015 -0500
gdbserver arm: Add casts
Trivial casts for C++.
Fixes things like
In file included from /home/simark/src/binutils-gdb/gdb/gdbserver/../common/common-defs.h:39:0,
from /home/simark/src/binutils-gdb/gdb/gdbserver/server.h:22,
from /home/simark/src/binutils-gdb/gdb/gdbserver/linux-arm-low.c:19:
/home/simark/src/binutils-gdb/gdb/gdbserver/linux-arm-low.c: In function â??int arm_get_hwcap(long unsigned int*)â??:
/home/simark/src/binutils-gdb/gdb/gdbserver/../../include/libiberty.h:711:38: error: invalid conversion from â??void*â?? to â??unsigned char*â?? [-fpermissive]
# define alloca(x) __builtin_alloca(x)
^
/home/simark/src/binutils-gdb/gdb/gdbserver/linux-arm-low.c:807:25: note: in expansion of macro â??allocaâ??
unsigned char *data = alloca (8);
^
gdb/gdbserver/ChangeLog:
* linux-aarch32-low.c (arm_fill_gregset): Add cast.
(arm_store_gregset): Likewise.
* linux-arm-low.c (arm_get_hwcap): Likewise.
(arm_read_description): Likewise.
Diff:
---
gdb/gdbserver/ChangeLog | 7 +++++++
gdb/gdbserver/linux-aarch32-low.c | 4 ++--
gdb/gdbserver/linux-arm-low.c | 4 ++--
3 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index ff0af3a..2906cc0 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,5 +1,12 @@
2015-11-03 Simon Marchi <simon.marchi@polymtl.ca>
+ * linux-aarch32-low.c (arm_fill_gregset): Add cast.
+ (arm_store_gregset): Likewise.
+ * linux-arm-low.c (arm_get_hwcap): Likewise.
+ (arm_read_description): Likewise.
+
+2015-11-03 Simon Marchi <simon.marchi@polymtl.ca>
+
* linux-aarch32-low.c (aarch32_regsets): Use NULL_REGSET.
2015-11-03 Simon Marchi <simon.marchi@polymtl.ca>
diff --git a/gdb/gdbserver/linux-aarch32-low.c b/gdb/gdbserver/linux-aarch32-low.c
index 891f8cd..221b5b9 100644
--- a/gdb/gdbserver/linux-aarch32-low.c
+++ b/gdb/gdbserver/linux-aarch32-low.c
@@ -39,7 +39,7 @@ void
arm_fill_gregset (struct regcache *regcache, void *buf)
{
int i;
- uint32_t *regs = buf;
+ uint32_t *regs = (uint32_t *) buf;
for (i = ARM_A1_REGNUM; i <= ARM_PC_REGNUM; i++)
collect_register (regcache, i, ®s[i]);
@@ -54,7 +54,7 @@ arm_store_gregset (struct regcache *regcache, const void *buf)
{
int i;
char zerobuf[8];
- const uint32_t *regs = buf;
+ const uint32_t *regs = (const uint32_t *) buf;
memset (zerobuf, 0, 8);
for (i = ARM_A1_REGNUM; i <= ARM_PC_REGNUM; i++)
diff --git a/gdb/gdbserver/linux-arm-low.c b/gdb/gdbserver/linux-arm-low.c
index e10955f..ae659dd 100644
--- a/gdb/gdbserver/linux-arm-low.c
+++ b/gdb/gdbserver/linux-arm-low.c
@@ -804,7 +804,7 @@ arm_prepare_to_resume (struct lwp_info *lwp)
static int
arm_get_hwcap (unsigned long *valp)
{
- unsigned char *data = alloca (8);
+ unsigned char *data = (unsigned char *) alloca (8);
int offset = 0;
while ((*the_target->read_auxv) (offset, data, 8) == 8)
@@ -855,7 +855,7 @@ arm_read_description (void)
/* Now make sure that the kernel supports reading these
registers. Support was added in 2.6.30. */
errno = 0;
- buf = xmalloc (32 * 8 + 4);
+ buf = (char *) xmalloc (32 * 8 + 4);
if (ptrace (PTRACE_GETVFPREGS, pid, 0, buf) < 0
&& errno == EIO)
result = tdesc_arm;