This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Cast void * to user_fpsimd_state *.


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=9caa33114e9195b0d28ad46d21a11a8f838ffb07

commit 9caa33114e9195b0d28ad46d21a11a8f838ffb07
Author: Yao Qi <yao.qi@linaro.org>
Date:   Thu Nov 19 13:58:29 2015 +0000

    Cast void * to user_fpsimd_state *.
    
    This patch fixes the following build error in GDBserver,
    
    gdb/gdbserver/linux-aarch64-low.c: In function 'void aarch64_fill_fpregset(regcache*, void*)':
    gdb/gdbserver/linux-aarch64-low.c:134:38: error: invalid conversion from 'void*' to 'user_fpsimd_state*' [-fpermissive]
       struct user_fpsimd_state *regset = buf;
                                          ^
    gdb/gdbserver/linux-aarch64-low.c: In function 'void aarch64_store_fpregset(regcache*, const void*)':
    gdb/gdbserver/linux-aarch64-low.c:146:44: error: invalid conversion from 'const void*' to 'const user_fpsimd_state*' [-fpermissive]
       const struct user_fpsimd_state *regset = buf;
                                                ^
    gdb/gdbserver:
    
    2015-11-19  Yao Qi  <yao.qi@linaro.org>
    
    	* linux-aarch64-low.c (aarch64_fill_fpregset): Cast buf to
    	struct user_fpsimd_state *.
    	(aarch64_store_fpregset): Likewise.

Diff:
---
 gdb/gdbserver/ChangeLog           | 6 ++++++
 gdb/gdbserver/linux-aarch64-low.c | 5 +++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 738ba18..0e3d673 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,5 +1,11 @@
 2015-11-19  Yao Qi  <yao.qi@linaro.org>
 
+	* linux-aarch64-low.c (aarch64_fill_fpregset): Cast buf to
+	struct user_fpsimd_state *.
+	(aarch64_store_fpregset): Likewise.
+
+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 --git a/gdb/gdbserver/linux-aarch64-low.c b/gdb/gdbserver/linux-aarch64-low.c
index 8d22218..a145f80 100644
--- a/gdb/gdbserver/linux-aarch64-low.c
+++ b/gdb/gdbserver/linux-aarch64-low.c
@@ -131,7 +131,7 @@ aarch64_store_gregset (struct regcache *regcache, const void *buf)
 static void
 aarch64_fill_fpregset (struct regcache *regcache, void *buf)
 {
-  struct user_fpsimd_state *regset = buf;
+  struct user_fpsimd_state *regset = (struct user_fpsimd_state *) buf;
   int i;
 
   for (i = 0; i < AARCH64_V_REGS_NUM; i++)
@@ -143,7 +143,8 @@ aarch64_fill_fpregset (struct regcache *regcache, void *buf)
 static void
 aarch64_store_fpregset (struct regcache *regcache, const void *buf)
 {
-  const struct user_fpsimd_state *regset = buf;
+  const struct user_fpsimd_state *regset
+    = (const struct user_fpsimd_state *) buf;
   int i;
 
   for (i = 0; i < AARCH64_V_REGS_NUM; i++)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]