aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/inferiors.c
diff options
context:
space:
mode:
authorSergio Durigan Junior <sergiodj@redhat.com>2016-12-22 13:30:42 -0500
committerSergio Durigan Junior <sergiodj@redhat.com>2017-06-07 19:56:01 -0400
commit043a49349c713dc329a2dfc413b082c3826ecdb8 (patch)
tree3c4c07e3fe64b479579a21ae40bd71723639857c /gdb/gdbserver/inferiors.c
parent156525114c1cbbace0dec223494b842ffc60d52e (diff)
downloadbinutils-043a49349c713dc329a2dfc413b082c3826ecdb8.zip
binutils-043a49349c713dc329a2dfc413b082c3826ecdb8.tar.gz
binutils-043a49349c713dc329a2dfc413b082c3826ecdb8.tar.bz2
Share parts of gdb/gdbthread.h with gdbserver
GDB and gdbserver now share 'switch_to_thread' because of fork_inferior. To make things clear, I created a new file name common/common-gdbthread.h, and left the implementation specific to each part. gdb/ChangeLog: 2017-06-07 Sergio Durigan Junior <sergiodj@redhat.com> * Makefile.in (HFILES_NO_SRCDIR): Add "common/common-gdbthread.h". * common/common-gdbthread.h: New file, with parts from "gdb/gdbthread.h". * gdbthread.h: Include "common-gdbthread.h". (switch_to_thread): Moved to "common/common-gdbthread.h". gdb/gdbserver/ChangeLog: 2017-06-07 Sergio Durigan Junior <sergiodj@redhat.com> * inferiors.c (switch_to_thread): New function.
Diffstat (limited to 'gdb/gdbserver/inferiors.c')
-rw-r--r--gdb/gdbserver/inferiors.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/gdbserver/inferiors.c b/gdb/gdbserver/inferiors.c
index b65a726..5a4a0d1 100644
--- a/gdb/gdbserver/inferiors.c
+++ b/gdb/gdbserver/inferiors.c
@@ -468,3 +468,12 @@ make_cleanup_restore_current_thread (void)
{
return make_cleanup (do_restore_current_thread_cleanup, current_thread);
}
+
+/* See common/common-gdbthread.h. */
+
+void
+switch_to_thread (ptid_t ptid)
+{
+ if (!ptid_equal (ptid, minus_one_ptid))
+ current_thread = find_thread_ptid (ptid);
+}