[2/6] Move have_ptrace_getregset to linux-nat.c
Commit Message
I'll let arm-linux-nat.c to use PTRACE_GETREGSET if kernel supports,
so this patch is to move have_ptrace_getregset from x86-linux-nat.c
to linux-nat.c.
gdb:
2015-05-28 Yao Qi <yao.qi@linaro.org>
* x86-linux-nat.c (have_ptrace_getregset): Move it to ...
* linux-nat.c: ... here.
* x86-linux-nat.h (have_ptrace_getregset): Move the declaration
to ...
* linux-nat.h: ... here.
---
gdb/linux-nat.c | 3 +++
gdb/linux-nat.h | 3 +++
gdb/x86-linux-nat.c | 2 --
gdb/x86-linux-nat.h | 2 --
4 files changed, 6 insertions(+), 4 deletions(-)
@@ -163,6 +163,9 @@ blocked. */
#define O_LARGEFILE 0
#endif
+/* Does the current host support PTRACE_GETREGSET? */
+int have_ptrace_getregset = -1;
+
/* The single-threaded native GNU/Linux target_ops. We save a pointer for
the use of the multi-threaded target. */
static struct target_ops *linux_ops;
@@ -115,6 +115,9 @@ struct lwp_info
native target is active. */
extern struct lwp_info *lwp_list;
+/* Does the current host support PTRACE_GETREGSET? */
+extern int have_ptrace_getregset;
+
/* Iterate over each active thread (light-weight process). */
#define ALL_LWPS(LP) \
for ((LP) = lwp_list; \
@@ -51,8 +51,6 @@ struct arch_lwp_info
int debug_registers_changed;
};
-/* Does the current host support PTRACE_GETREGSET? */
-int have_ptrace_getregset = -1;
/* linux_nat_new_fork hook. */
@@ -20,8 +20,6 @@
#ifndef X86_LINUX_NAT_H
#define X86_LINUX_NAT_H 1
-/* Does the current host support PTRACE_GETREGSET? */
-extern int have_ptrace_getregset;
/* Helper for ps_get_thread_area. Sets BASE_ADDR to a pointer to