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.
This commit is contained in:
Sergio Durigan Junior
2016-12-22 13:30:42 -05:00
parent 156525114c
commit 043a49349c
6 changed files with 48 additions and 4 deletions

View File

@ -32,6 +32,7 @@ struct symtab;
#include "target/waitstatus.h"
#include "cli/cli-utils.h"
#include "common/refcounted-object.h"
#include "common-gdbthread.h"
/* Frontend view of the thread state. Possible extensions: stepping,
finishing, until(ling),... */
@ -493,10 +494,6 @@ extern struct thread_info *iterate_over_threads (thread_callback_func, void *);
extern int thread_count (void);
/* Switch from one thread to another. Also sets the STOP_PC
global. */
extern void switch_to_thread (ptid_t ptid);
/* Switch from one thread to another. Does not read registers and
sets STOP_PC to -1. */
extern void switch_to_thread_no_regs (struct thread_info *thread);