gdbserver: turn target op 'thread_alive' into a method

gdbserver/ChangeLog:
2020-02-20  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>

	Turn process_stratum_target's thread_alive op into a method of
	process_target.

	* target.h (struct process_stratum_target): Remove the target op.
	(class process_target): Add the target op.
	(mythread_alive): Update the macro.

	Update the derived classes and callers below.

	* linux-low.cc (linux_target_ops): Update.
	(linux_thread_alive): Turn into ...
	(linux_process_target::thread_alive): ... this.
	(wait_for_sigstop): Update.
	* linux-low.h (class linux_process_target): Update.
	* lynx-low.cc (lynx_target_ops): Update.
	(lynx_thread_alive): Turn into ...
	(lynx_process_target::thread_alive): ... this.
	* lynx-low.h (class lynx_process_target): Update.
	* nto-low.cc (nto_target_ops): Update.
	(nto_thread_alive): Turn into ...
	(nto_process_target::thread_alive): ... this.
	* nto-low.h (class nto_process_target): Update.
	* win32-low.cc (win32_target_ops): Update.
	(win32_thread_alive): Turn into ...
	(win32_process_target::thread_alive): ... this.
	* win32-low.h (class win32_process_target): Update.
This commit is contained in:
Tankut Baris Aktemur
2020-02-17 16:11:52 +01:00
parent 95a49a3939
commit 13d3d99b27
10 changed files with 54 additions and 21 deletions

View File

@@ -1681,9 +1681,10 @@ linux_process_target::join (int pid)
} while (ret != -1 || errno != ECHILD);
}
/* Return nonzero if the given thread is still alive. */
static int
linux_thread_alive (ptid_t ptid)
/* Return true if the given thread is still alive. */
bool
linux_process_target::thread_alive (ptid_t ptid)
{
struct lwp_info *lwp = find_lwp_pid (ptid);
@@ -4004,7 +4005,7 @@ wait_for_sigstop (void)
&wstat, __WALL);
gdb_assert (ret == -1);
if (saved_thread == NULL || linux_thread_alive (saved_tid))
if (saved_thread == NULL || mythread_alive (saved_tid))
current_thread = saved_thread;
else
{
@@ -7358,7 +7359,6 @@ linux_get_hwcap2 (int wordsize)
static linux_process_target the_linux_target;
static process_stratum_target linux_target_ops = {
linux_thread_alive,
linux_resume,
linux_wait,
linux_fetch_registers,