[04/13,v2] Make linux_stop_lwp be a shared function

Message ID 1412848358-9958-5-git-send-email-gbenson@redhat.com
State Committed
Headers

Commit Message

Gary Benson Oct. 9, 2014, 9:52 a.m. UTC
  Both GDB and gdbserver had linux_stop_lwp functions with identical
declarations.  This commit moves these to nat/linux-nat.h to allow
shared code to use the function.

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(-)
  

Comments

Pedro Alves Oct. 28, 2014, 12:56 p.m. UTC | #1
On 10/09/2014 10:52 AM, Gary Benson wrote:
> Both GDB and gdbserver had linux_stop_lwp functions with identical
> declarations.  This commit moves these to nat/linux-nat.h to allow
> shared code to use the function.
> 
> 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.

OK.

Thanks,
Pedro Alves
  

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 a2a0a98..da94f2f 100644
--- a/gdb/nat/linux-nat.h
+++ b/gdb/nat/linux-nat.h
@@ -45,4 +45,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 */