From: Gary Benson <gbenson@redhat.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 13/13 v2] Move duplicated Linux x86 code to nat/x86-linux.c
Date: Thu, 09 Oct 2014 10:44:00 -0000 [thread overview]
Message-ID: <1412848358-9958-14-git-send-email-gbenson@redhat.com> (raw)
In-Reply-To: <1412848358-9958-1-git-send-email-gbenson@redhat.com>
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): Removed.
(x86_linux_prepare_to_resume): Likewise.
---
gdb/ChangeLog | 10 ++++++++++
gdb/gdbserver/ChangeLog | 5 +++++
gdb/gdbserver/linux-x86-low.c | 16 ----------------
gdb/nat/x86-linux.c | 17 +++++++++++++++++
gdb/nat/x86-linux.h | 8 ++++++++
gdb/x86-linux-nat.c | 16 ----------------
6 files changed, 40 insertions(+), 32 deletions(-)
diff --git a/gdb/gdbserver/linux-x86-low.c b/gdb/gdbserver/linux-x86-low.c
index b1d2d27..40e96e2 100644
--- a/gdb/gdbserver/linux-x86-low.c
+++ b/gdb/gdbserver/linux-x86-low.c
@@ -637,14 +637,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 *
@@ -654,14 +646,6 @@ x86_debug_reg_state (pid_t pid)
return &proc->private->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
diff --git a/gdb/nat/x86-linux.c b/gdb/nat/x86-linux.c
index efeeab9..7dd3f9b 100644
--- a/gdb/nat/x86-linux.c
+++ b/gdb/nat/x86-linux.c
@@ -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);
+}
diff --git a/gdb/nat/x86-linux.h b/gdb/nat/x86-linux.h
index 6409898..76271b5 100644
--- a/gdb/nat/x86-linux.h
+++ b/gdb/nat/x86-linux.h
@@ -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 */
diff --git a/gdb/x86-linux-nat.c b/gdb/x86-linux-nat.c
index 97ce443..61710ce 100644
--- a/gdb/x86-linux-nat.c
+++ b/gdb/x86-linux-nat.c
@@ -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. */
--
1.7.1
next prev parent reply other threads:[~2014-10-09 10:44 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-09 9:53 [PATCH 00/13 v2] Refactor low-level Linux x86 debug register code Gary Benson
2014-10-09 9:53 ` [PATCH 04/13 v2] Make linux_stop_lwp be a shared function Gary Benson
2014-10-28 12:56 ` Pedro Alves
2014-10-09 9:53 ` [PATCH 01/13 v2] Introduce current_lwp_ptid Gary Benson
2014-10-28 12:56 ` Pedro Alves
2014-10-28 16:44 ` Doug Evans
2014-10-28 17:12 ` Doug Evans
2014-10-28 17:13 ` Doug Evans
2014-10-28 18:35 ` Pedro Alves
2014-10-28 19:43 ` Doug Evans
2014-10-31 18:57 ` Doug Evans
2014-10-09 9:53 ` [PATCH 02/13 v2] Add x86_debug_reg_state to gdbserver Gary Benson
2014-10-28 12:56 ` Pedro Alves
2014-10-09 9:54 ` [PATCH 12/13 v2] Move low-level Linux x86 debug register code to a shared file Gary Benson
2014-10-28 13:01 ` Pedro Alves
2014-10-09 10:18 ` [PATCH 07/13 v2] Make lwp_info.arch_private handling shared Gary Benson
2014-10-28 12:57 ` Pedro Alves
2014-10-09 10:18 ` [PATCH 05/13 v2] Introduce basic LWP accessors Gary Benson
2014-10-28 12:57 ` Pedro Alves
2014-10-09 10:18 ` [PATCH 03/13 v2] Add iterate_over_lwps to gdbserver Gary Benson
2014-10-28 12:56 ` Pedro Alves
2014-10-09 10:21 ` [PATCH 08/13 v2] Rename gdbserver's low-level Linux x86 debug register accessors Gary Benson
2014-10-28 12:58 ` Pedro Alves
2014-10-09 10:21 ` [PATCH 10/13 v2] Linux x86 low-level debug register comment synchronization Gary Benson
2014-10-28 12:59 ` Pedro Alves
2014-10-09 10:35 ` [PATCH 11/13 v2] Introduce x86_linux_update_debug_registers Gary Benson
2014-10-28 13:00 ` Pedro Alves
2014-10-09 10:35 ` [PATCH 06/13 v2] Change signature of linux_target_ops.new_thread Gary Benson
2014-10-28 12:57 ` Pedro Alves
2014-10-09 10:44 ` Gary Benson [this message]
2014-10-28 13:01 ` [PATCH 13/13 v2] Move duplicated Linux x86 code to nat/x86-linux.c Pedro Alves
2014-10-09 10:44 ` [PATCH 09/13 v2] Linux x86 low-level debug register code synchronization Gary Benson
2014-10-28 12:59 ` Pedro Alves
2015-03-24 14:11 ` [pushed] Refactor low-level Linux x86 debug register code Gary Benson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1412848358-9958-14-git-send-email-gbenson@redhat.com \
--to=gbenson@redhat.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox