Fix siginfo C++ build error
authorSimon Marchi <simon.marchi@ericsson.com>
Tue, 9 Feb 2016 11:18:15 +0000 (11:18 +0000)
committerPedro Alves <palves@redhat.com>
Tue, 9 Feb 2016 11:18:15 +0000 (11:18 +0000)
Change the signature of gdbserver's siginfo_fixup functions so that it's
in line with gdb's.  This gets rid of the following build error in C++:

  /home/emaisin/src/binutils-gdb/gdb/gdbserver/linux-x86-low.c: In function ‘int x86_siginfo_fixup(siginfo_t*, void*, int)’:
  /home/emaisin/src/binutils-gdb/gdb/gdbserver/linux-x86-low.c:694:21: error: invalid conversion from ‘void*’ to ‘gdb_byte* {aka unsigned char*}’ [-fpermissive]
               FIXUP_32);
                       ^
  In file included from /home/emaisin/src/binutils-gdb/gdb/gdbserver/linux-x86-low.c:31:0:
  /home/emaisin/src/binutils-gdb/gdb/gdbserver/../nat/amd64-linux-siginfo.h:52:5: error:   initializing argument 2 of ‘int amd64_linux_siginfo_fixup_common(siginfo_t*, gdb_byte*, int, amd64_siginfo_fixup_mode)’ [-fpermissive]
   int amd64_linux_siginfo_fixup_common (siginfo_t *native, gdb_byte *inf,
       ^
  /home/emaisin/src/binutils-gdb/gdb/gdbserver/linux-x86-low.c:698:20: error: invalid conversion from ‘void*’ to ‘gdb_byte* {aka unsigned char*}’ [-fpermissive]
             FIXUP_X32);
                      ^
  In file included from /home/emaisin/src/binutils-gdb/gdb/gdbserver/linux-x86-low.c:31:0:
  /home/emaisin/src/binutils-gdb/gdb/gdbserver/../nat/amd64-linux-siginfo.h:52:5: error:   initializing argument 2 of ‘int amd64_linux_siginfo_fixup_common(siginfo_t*, gdb_byte*, int, amd64_siginfo_fixup_mode)’ [-fpermissive]
   int amd64_linux_siginfo_fixup_common (siginfo_t *native, gdb_byte *inf,
       ^

gdb/gdbserver/ChangeLog:

* linux-aarch64-low.c (aarch64_linux_siginfo_fixup): Change
void * to gdb_byte *.
* linux-low.c (siginfo_fixup): Likewise.
(linux_xfer_siginfo): Likewise.
* linux-low.h (struct linux_target_ops) <siginfo_fixup>:
Likewise.
* linux-x86-low.c (x86_siginfo_fixup): Likewise.

gdb/gdbserver/ChangeLog
gdb/gdbserver/linux-aarch64-low.c
gdb/gdbserver/linux-low.c
gdb/gdbserver/linux-low.h
gdb/gdbserver/linux-x86-low.c

index e0da782a0ac1d5f1cbb227bdac9d7c80f5c2851c..3d799c15ef0677525f40a397c47d1fa0fc052082 100644 (file)
@@ -1,3 +1,13 @@
+2016-02-09  Simon Marchi  <simon.marchi@ericsson.com>
+
+       * linux-aarch64-low.c (aarch64_linux_siginfo_fixup): Change
+       void * to gdb_byte *.
+       * linux-low.c (siginfo_fixup): Likewise.
+       (linux_xfer_siginfo): Likewise.
+       * linux-low.h (struct linux_target_ops) <siginfo_fixup>:
+       Likewise.
+       * linux-x86-low.c (x86_siginfo_fixup): Likewise.
+
 2016-02-02  Walfred Tedeschi  <walfred.tedeschi@intel.com>
 
        * configure.srv (x86_64-*-linux*): Add amd64-linux-siginfo.o
index 1cc9f59f6f22133e940c0604c93c7a080c2f042f..806a76260f89d370139b3c2d88eda8d62fce9750 100644 (file)
@@ -431,7 +431,7 @@ ps_get_thread_area (const struct ps_prochandle *ph,
 /* Implementation of linux_target_ops method "siginfo_fixup".  */
 
 static int
-aarch64_linux_siginfo_fixup (siginfo_t *native, void *inf, int direction)
+aarch64_linux_siginfo_fixup (siginfo_t *native, gdb_byte *inf, int direction)
 {
   /* Is the inferior 32-bit?  If so, then fixup the siginfo object.  */
   if (!is_64bit_tdesc ())
index bce7580dec4ac5c7e2f153bf85710dddeb3e4a68..8b025bd1b0a8f8b7d67cbcacdf7718404eaa266e 100644 (file)
@@ -5982,7 +5982,7 @@ linux_qxfer_osdata (const char *annex,
    layout of the inferiors' architecture.  */
 
 static void
-siginfo_fixup (siginfo_t *siginfo, void *inf_siginfo, int direction)
+siginfo_fixup (siginfo_t *siginfo, gdb_byte *inf_siginfo, int direction)
 {
   int done = 0;
 
@@ -6006,7 +6006,7 @@ linux_xfer_siginfo (const char *annex, unsigned char *readbuf,
 {
   int pid;
   siginfo_t siginfo;
-  char inf_siginfo[sizeof (siginfo_t)];
+  gdb_byte inf_siginfo[sizeof (siginfo_t)];
 
   if (current_thread == NULL)
     return -1;
index 0d9eb4008c44e133e4df7492b9f437c8af29b3ac..4ec85504412728ff15ec37cc4f6d40313dae6fdf 100644 (file)
@@ -181,7 +181,7 @@ struct linux_target_ops
      Returns true if any conversion was done; false otherwise.
      If DIRECTION is 1, then copy from INF to NATIVE.
      If DIRECTION is 0, copy from NATIVE to INF.  */
-  int (*siginfo_fixup) (siginfo_t *native, void *inf, int direction);
+  int (*siginfo_fixup) (siginfo_t *native, gdb_byte *inf, int direction);
 
   /* Hook to call when a new process is created or attached to.
      If extra per-process architecture-specific data is needed,
index ff51a95357b6e929fb00f08d00bacdb8ffc74759..0c4954a58dc9c4d87a8d776fd28d498307cf4332 100644 (file)
@@ -681,7 +681,7 @@ x86_debug_reg_state (pid_t pid)
    INF.  */
 
 static int
-x86_siginfo_fixup (siginfo_t *native, void *inf, int direction)
+x86_siginfo_fixup (siginfo_t *native, gdb_byte *inf, int direction)
 {
 #ifdef __x86_64__
   unsigned int machine;
This page took 0.036984 seconds and 4 git commands to generate.