Move duplicated Linux x86 code to nat/x86-linux.c
authorGary Benson <gbenson@redhat.com>
Tue, 24 Mar 2015 14:05:45 +0000 (14:05 +0000)
committerGary Benson <gbenson@redhat.com>
Tue, 24 Mar 2015 14:05:45 +0000 (14:05 +0000)
This commit moves two identical functions from gdb/x86-linux-nat.c and
gdb/gdbserver/linux-x86-low.c into the shared file gdb/nat/x86-linux.c.

gdb/ChangeLog:

* nat/x86-linux.h (x86_linux_new_thread): New declaration.
(x86_linux_prepare_to_resume): Likewise.
* x86-linux-nat.c (x86_linux_new_thread):
Moved to nat/x86-linux.c.
(x86_linux_prepare_to_resume): Likewise.
* nat/x86-linux.c (x86_linux_new_thread): New function.
(x86_linux_prepare_to_resume): Likewise.

gdb/gdbserver/ChangeLog:

* linux-x86-low.c (x86_linux_new_thread): Moved to
nat/x86-linux.c.
(x86_linux_prepare_to_resume): Likewise.

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

index 7dcec1fdbe25ca54c116d57e1851cff7372da131..62a8a449d71cdf5868f13c65ff959c61b9a0f6e3 100644 (file)
@@ -1,3 +1,13 @@
+2015-03-24  Gary Benson  <gbenson@redhat.com>
+
+       * nat/x86-linux.h (x86_linux_new_thread): New declaration.
+       (x86_linux_prepare_to_resume): Likewise.
+       * x86-linux-nat.c (x86_linux_new_thread):
+       Moved to nat/x86-linux.c.
+       (x86_linux_prepare_to_resume): Likewise.
+       * nat/x86-linux.c (x86_linux_new_thread): New function.
+       (x86_linux_prepare_to_resume): Likewise.
+
 2015-03-24  Gary Benson  <gbenson@redhat.com>
 
        * nat/x86-linux-dregs.h: New file.
index 8d1d84464dd6114aff8597b2d4e5e65feedb79e8..d9bc729789b3227caa84ed82e5e03d3701c20a60 100644 (file)
@@ -1,3 +1,9 @@
+2015-03-24  Gary Benson  <gbenson@redhat.com>
+
+       * linux-x86-low.c (x86_linux_new_thread): Moved to
+       nat/x86-linux.c.
+       (x86_linux_prepare_to_resume): Likewise.
+
 2015-03-24  Gary Benson  <gbenson@redhat.com>
 
        * Makefile.in (x86-linux-dregs.o): New rule.
index 8a3b5a81ebed1103f63dbab969cfba1cae8c46f7..e293ba4ffdc65d0ed8b2d9f5b36f40aa894569cd 100644 (file)
@@ -640,14 +640,6 @@ x86_linux_new_process (void)
   return info;
 }
 
-/* Called when a new thread is detected.  */
-
-static void
-x86_linux_new_thread (struct lwp_info *lwp)
-{
-  lwp_set_debug_registers_changed (lwp, 1);
-}
-
 /* See nat/x86-dregs.h.  */
 
 struct x86_debug_reg_state *
@@ -657,14 +649,6 @@ x86_debug_reg_state (pid_t pid)
 
   return &proc->priv->arch_private->debug_reg_state;
 }
-
-/* Called prior to resuming a thread.  */
-
-static void
-x86_linux_prepare_to_resume (struct lwp_info *lwp)
-{
-  x86_linux_update_debug_registers (lwp);
-}
 \f
 /* When GDBSERVER is built as a 64-bit application on linux, the
    PTRACE_GETSIGINFO data is always presented in 64-bit layout.  Since
index a2bd36895c41a0b3c36110f22ce895742a09fbba..e78315625c3523aa7fe154f456885934165cc371 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "common-defs.h"
 #include "x86-linux.h"
+#include "x86-linux-dregs.h"
 
 /* Per-thread arch-specific data we want to keep.  */
 
@@ -55,3 +56,19 @@ lwp_debug_registers_changed (struct lwp_info *lwp)
 
   return info->debug_registers_changed;
 }
+
+/* See nat/x86-linux.h.  */
+
+void
+x86_linux_new_thread (struct lwp_info *lwp)
+{
+  lwp_set_debug_registers_changed (lwp, 1);
+}
+
+/* See nat/x86-linux.h.  */
+
+void
+x86_linux_prepare_to_resume (struct lwp_info *lwp)
+{
+  x86_linux_update_debug_registers (lwp);
+}
index 8dd66e4b49f0875667464abb7741f0e9fd6c983c..327a005a465da24bba20285e53e558d804bd76d4 100644 (file)
@@ -35,4 +35,12 @@ extern void lwp_set_debug_registers_changed (struct lwp_info *lwp,
 
 extern int lwp_debug_registers_changed (struct lwp_info *lwp);
 
+/* Function to call when a new thread is detected.  */
+
+extern void x86_linux_new_thread (struct lwp_info *lwp);
+
+/* Function to call prior to resuming a thread.  */
+
+extern void x86_linux_prepare_to_resume (struct lwp_info *lwp);
+
 #endif /* X86_LINUX_H */
index 84021fb9cfd3b55c4438c8f56b881daf9a517507..f8eb236fc86852e8077fd65819321f4113f5cfbd 100644 (file)
@@ -52,22 +52,6 @@ struct arch_lwp_info
 
 /* Does the current host support PTRACE_GETREGSET?  */
 int have_ptrace_getregset = -1;
-
-/* Called prior to resuming a thread.  */
-
-static void
-x86_linux_prepare_to_resume (struct lwp_info *lwp)
-{
-  x86_linux_update_debug_registers (lwp);
-}
-
-/* Called when a new thread is detected.  */
-
-static void
-x86_linux_new_thread (struct lwp_info *lwp)
-{
-  lwp_set_debug_registers_changed (lwp, 1);
-}
 \f
 
 /* linux_nat_new_fork hook.   */
This page took 0.036214 seconds and 4 git commands to generate.