]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Move PTRACE_GETREGSET and PTRACE_SETREGSET to nat/linux-ptrace.h
authorYao Qi <yao.qi@linaro.org>
Mon, 1 Jun 2015 11:13:02 +0000 (12:13 +0100)
committerYao Qi <yao.qi@linaro.org>
Mon, 1 Jun 2015 11:13:02 +0000 (12:13 +0100)
Macros PTRACE_GETREGSET and PTRACE_SETREGSET are defined locally in
some places in GDB and GDBserver.  This patch is to move them to
nat/linux-ptrace.h to avoid duplication.

gdb:

2015-06-01  Yao Qi  <yao.qi@linaro.org>

* amd64-linux-nat.c: Include "nat/linux-ptrace.h".
* i386-linux-nat.c: Likewise.
* nat/linux-ptrace.h (PTRACE_GETREGSET, PTRACE_SETREGSET): Define.
* s390-linux-nat.c: Include "nat/linux-ptrace.h".
(PTRACE_GETREGSET, PTRACE_SETREGSET): Remove.
* x86-linux-nat.c: Include "nat/linux-ptrace.h".
* x86-linux-nat.h (PTRACE_GETREGSET, PTRACE_SETREGSET): Remove.

gdb/gdbserver:

2015-06-01  Yao Qi  <yao.qi@linaro.org>

* linux-s390-low.c (PTRACE_GETREGSET, PTRACE_SETREGSET): Remove.
* linux-x86-low.c: Likewise.

gdb/ChangeLog
gdb/amd64-linux-nat.c
gdb/gdbserver/ChangeLog
gdb/gdbserver/linux-s390-low.c
gdb/gdbserver/linux-x86-low.c
gdb/i386-linux-nat.c
gdb/nat/linux-ptrace.h
gdb/s390-linux-nat.c
gdb/x86-linux-nat.c
gdb/x86-linux-nat.h

index 72e6f4a08d87da67b33b9d2b6cead2d975ba9e27..8dd98611056ef6fde4984e80300fc53224dd50a4 100644 (file)
@@ -1,3 +1,13 @@
+2015-06-01  Yao Qi  <yao.qi@linaro.org>
+
+       * amd64-linux-nat.c: Include "nat/linux-ptrace.h".
+       * i386-linux-nat.c: Likewise.
+       * nat/linux-ptrace.h (PTRACE_GETREGSET, PTRACE_SETREGSET): Define.
+       * s390-linux-nat.c: Include "nat/linux-ptrace.h".
+       (PTRACE_GETREGSET, PTRACE_SETREGSET): Remove.
+       * x86-linux-nat.c: Include "nat/linux-ptrace.h".
+       * x86-linux-nat.h (PTRACE_GETREGSET, PTRACE_SETREGSET): Remove.
+
 2015-05-30  Eli Zaretskii  <eliz@gnu.org>
 
        * go32-nat.c (go32_xfer_memory): Fix the return value to be
index 22a13593c8b4ed046ad7ff0e52abbb4ed67dce77..30892ca96852b1709c860f5e896fe5b4eb6cf979 100644 (file)
@@ -37,6 +37,7 @@
 #include "x86-xstate.h"
 
 #include "x86-linux-nat.h"
+#include "nat/linux-ptrace.h"
 
 /* Mapping between the general-purpose registers in GNU/Linux x86-64
    `struct user' format and GDB's register cache layout for GNU/Linux
index 4e4f42935b620e145ef0e34b4633dfa24adee5c0..afba52ac59d79c890c6e7bfdb33dd2f9b7dffcfd 100644 (file)
@@ -1,3 +1,8 @@
+2015-06-01  Yao Qi  <yao.qi@linaro.org>
+
+       * linux-s390-low.c (PTRACE_GETREGSET, PTRACE_SETREGSET): Remove.
+       * linux-x86-low.c: Likewise.
+
 2015-05-28  Don Breazeal  <donb@codesourcery.com>
 
        * linux-low.c (handle_extended_wait): Initialize
index afee1ff44c9284463285d4285b285a2b1b438d6c..5d4ea1ff45f75bbe07b0a1c2ca46a3e8d02150e6 100644 (file)
 #define HWCAP_S390_VX 2048
 #endif
 
-#ifndef PTRACE_GETREGSET
-#define PTRACE_GETREGSET 0x4204
-#endif
-
-#ifndef PTRACE_SETREGSET
-#define PTRACE_SETREGSET 0x4205
-#endif
-
 /* Defined in auto-generated file s390-linux32.c.  */
 void init_registers_s390_linux32 (void);
 extern const struct target_desc *tdesc_s390_linux32;
index 4aef7b79825e0a65ddc508244e76b073b5233848..484eadba054266accaaf6ef0c3854bfbe31837d6 100644 (file)
@@ -120,15 +120,6 @@ static const char *xmltarget_amd64_linux_no_xml = "@<target>\
 #include <sys/ptrace.h>
 #include <sys/uio.h>
 
-#ifndef PTRACE_GETREGSET
-#define PTRACE_GETREGSET       0x4204
-#endif
-
-#ifndef PTRACE_SETREGSET
-#define PTRACE_SETREGSET       0x4205
-#endif
-
-
 #ifndef PTRACE_GET_THREAD_AREA
 #define PTRACE_GET_THREAD_AREA 25
 #endif
index 8cb8c66c301d62eb21a2da98351582de418bc191..56663613a89128b1ead1d70467e128eaff41d225 100644 (file)
@@ -34,6 +34,7 @@
 #include "x86-xstate.h"
 
 #include "x86-linux-nat.h"
+#include "nat/linux-ptrace.h"
 
 /* The register sets used in GNU/Linux ELF core-dumps are identical to
    the register sets in `struct user' that is used for a.out
index 1db0cde128a446fcf3d55abacb20ea9274801293..be6c39528c9d1f8693b1c6e57ae372390196469d 100644 (file)
@@ -43,6 +43,14 @@ struct buffer;
 # define PTRACE_SETSIGINFO 0x4203
 #endif /* PTRACE_GETSIGINF */
 
+#ifndef PTRACE_GETREGSET
+#define PTRACE_GETREGSET       0x4204
+#endif
+
+#ifndef PTRACE_SETREGSET
+#define PTRACE_SETREGSET       0x4205
+#endif
+
 /* If the system headers did not provide the constants, hard-code the normal
    values.  */
 #ifndef PTRACE_EVENT_FORK
index 4cd3192a42089e74beacfa7363c13cab791c6798..cedc505e1bddff1a44218f977aebdb81c3d3da2d 100644 (file)
@@ -27,6 +27,7 @@
 #include "auxv.h"
 #include "gregset.h"
 #include "regset.h"
+#include "nat/linux-ptrace.h"
 
 #include "s390-linux-tdep.h"
 #include "elf/common.h"
 #include <sys/ucontext.h>
 #include <elf.h>
 
-#ifndef PTRACE_GETREGSET
-#define PTRACE_GETREGSET 0x4204
-#endif
-
-#ifndef PTRACE_SETREGSET
-#define PTRACE_SETREGSET 0x4205
-#endif
-
 /* Per-thread arch-specific data.  */
 
 struct arch_lwp_info
index f8eb236fc86852e8077fd65819321f4113f5cfbd..0026d264a20ea5d08f74ae5a1f589bac29340662 100644 (file)
@@ -41,6 +41,7 @@
 #include "nat/linux-nat.h"
 #include "nat/x86-linux.h"
 #include "nat/x86-linux-dregs.h"
+#include "nat/linux-ptrace.h"
 
 /* Per-thread arch-specific data we want to keep.  */
 
index 7928aa09f409eea17275b7789c787a9d64994037..7c4d87c47cc801236f5b3d0e809818820e231a05 100644 (file)
 #ifndef X86_LINUX_NAT_H
 #define X86_LINUX_NAT_H 1
 
-#ifndef PTRACE_GETREGSET
-#define PTRACE_GETREGSET       0x4204
-#endif
-
-#ifndef PTRACE_SETREGSET
-#define PTRACE_SETREGSET       0x4205
-#endif
-
 /* Does the current host support PTRACE_GETREGSET?  */
 extern int have_ptrace_getregset;
 \f