[05/14] Make linux_stop_lwp be a shared function

Message ID 1410189922-18320-6-git-send-email-gbenson@redhat.com
State Deferred
Headers

Commit Message

Gary Benson Sept. 8, 2014, 3:25 p.m. UTC
  Both GDB and gdbserver had identical linux_stop_lwp functions.
This commit moves its declaration to nat/linux-nat.h to allow
shared code to use it.

gdb/ChangeLog:

	* linux-nat.h (linux_stop_lwp): Move declaration to...
	* nat/linux-nat.h (linux_stop_lwp): New declaration.

gdb/gdbserver/ChangeLog:

	* linux-low.h (linux_stop_lwp): Remove declaration.
---
 gdb/ChangeLog             |    5 +++++
 gdb/gdbserver/ChangeLog   |    4 ++++
 gdb/gdbserver/linux-low.h |    2 +-
 gdb/linux-nat.h           |    2 +-
 gdb/nat/linux-nat.h       |    5 +++++
 5 files changed, 16 insertions(+), 2 deletions(-)
  

Patch

diff --git a/gdb/gdbserver/linux-low.h b/gdb/gdbserver/linux-low.h
index 11d73f3..697e0fb 100644
--- a/gdb/gdbserver/linux-low.h
+++ b/gdb/gdbserver/linux-low.h
@@ -359,7 +359,7 @@  int linux_attach_lwp (ptid_t ptid);
 char *linux_attach_fail_reason_string (ptid_t ptid, int err);
 
 struct lwp_info *find_lwp_pid (ptid_t ptid);
-void linux_stop_lwp (struct lwp_info *lwp);
+/* For linux_stop_lwp see nat/linux-nat.h.  */
 
 #ifdef HAVE_LINUX_REGSETS
 void initialize_regsets_info (struct regsets_info *regsets_info);
diff --git a/gdb/linux-nat.h b/gdb/linux-nat.h
index 0195c5a..e1edbf8 100644
--- a/gdb/linux-nat.h
+++ b/gdb/linux-nat.h
@@ -124,7 +124,7 @@  void linux_proc_pending_signals (int pid, sigset_t *pending,
 
 extern int lin_lwp_attach_lwp (ptid_t ptid);
 
-extern void linux_stop_lwp (struct lwp_info *lwp);
+/* For linux_stop_lwp see nat/linux-nat.h.  */
 
 /* Create a prototype generic GNU/Linux target.  The client can
    override it with local methods.  */
diff --git a/gdb/nat/linux-nat.h b/gdb/nat/linux-nat.h
index 59dfbde..da77d6b 100644
--- a/gdb/nat/linux-nat.h
+++ b/gdb/nat/linux-nat.h
@@ -40,4 +40,9 @@  extern struct lwp_info *iterate_over_lwps (ptid_t filter,
 					   iterate_over_lwps_ftype callback,
 					   void *data);
 
+/* Cause LWP to stop.  This function must be provided by the
+   client.  */
+
+extern void linux_stop_lwp (struct lwp_info *lwp);
+
 #endif /* LINUX_NAT_H */