This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Cast void * to struct user_pt_regs *
- From: Yao Qi <qiyao at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 19 Nov 2015 14:02:34 -0000
- Subject: [binutils-gdb] Cast void * to struct user_pt_regs *
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=6a69a054f7581d16d4f65f80c45b92176311e1ef
commit 6a69a054f7581d16d4f65f80c45b92176311e1ef
Author: Yao Qi <yao.qi@linaro.org>
Date: Thu Nov 19 13:58:29 2015 +0000
Cast void * to struct user_pt_regs *
This patch fixes the following GDBserver build errors in C++.
gdb/gdbserver/linux-aarch64-low.c:108:33: error: invalid conversion from 'void*' to 'user_pt_regs*' [-fpermissive]
struct user_pt_regs *regset = buf;
^
gdb/gdbserver/linux-aarch64-low.c: In function 'void aarch64_store_gregset(regcache*, const void*)':
gdb/gdbserver/linux-aarch64-low.c:121:39: error: invalid conversion from 'const void*' to 'const user_pt_regs*' [-fpermissive]
const struct user_pt_regs *regset = buf;
gdb/gdbserver:
2015-11-19 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c (aarch64_fill_gregset): Cast buf to
struct user_pt_regs *.
(aarch64_store_gregset): Likewise.
Diff:
---
gdb/gdbserver/ChangeLog | 6 ++++++
gdb/gdbserver/linux-aarch64-low.c | 4 ++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 798c5df..738ba18 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,9 @@
+2015-11-19 Yao Qi <yao.qi@linaro.org>
+
+ * linux-aarch64-low.c (aarch64_fill_gregset): Cast buf to
+ struct user_pt_regs *.
+ (aarch64_store_gregset): Likewise.
+
2015-11-18 Pedro Alves <palves@redhat.com>
* Makefile.in (all_object_files): Add $IPA_OBJS.
diff --git a/gdb/gdbserver/linux-aarch64-low.c b/gdb/gdbserver/linux-aarch64-low.c
index 4f23392..8d22218 100644
--- a/gdb/gdbserver/linux-aarch64-low.c
+++ b/gdb/gdbserver/linux-aarch64-low.c
@@ -105,7 +105,7 @@ aarch64_cannot_fetch_register (int regno)
static void
aarch64_fill_gregset (struct regcache *regcache, void *buf)
{
- struct user_pt_regs *regset = buf;
+ struct user_pt_regs *regset = (struct user_pt_regs *) buf;
int i;
for (i = 0; i < AARCH64_X_REGS_NUM; i++)
@@ -118,7 +118,7 @@ aarch64_fill_gregset (struct regcache *regcache, void *buf)
static void
aarch64_store_gregset (struct regcache *regcache, const void *buf)
{
- const struct user_pt_regs *regset = buf;
+ const struct user_pt_regs *regset = (const struct user_pt_regs *) buf;
int i;
for (i = 0; i < AARCH64_X_REGS_NUM; i++)