gdb: make find_thread_ptid a process_stratum_target method

Make find_thread_ptid (the overload that takes a process_stratum_target)
a method of process_stratum_target.

Change-Id: Ib190a925a83c6b93e9c585dc7c6ab65efbdd8629
Reviewed-By: Tom Tromey <tom@tromey.com>
This commit is contained in:
Simon Marchi
2023-03-27 12:53:55 -04:00
committed by Simon Marchi
parent 3c8af02fa0
commit 9213a6d79a
25 changed files with 71 additions and 75 deletions

View File

@@ -514,17 +514,6 @@ find_thread_id (struct inferior *inf, int thr_num)
/* See gdbthread.h. */
struct thread_info *
find_thread_ptid (process_stratum_target *targ, ptid_t ptid)
{
inferior *inf = find_inferior_ptid (targ, ptid);
if (inf == NULL)
return NULL;
return inf->find_thread (ptid);
}
/* See gdbthread.h. */
struct thread_info *
find_thread_by_handle (gdb::array_view<const gdb_byte> handle,
struct inferior *inf)
@@ -598,7 +587,7 @@ valid_global_thread_id (int global_id)
bool
in_thread_list (process_stratum_target *targ, ptid_t ptid)
{
return find_thread_ptid (targ, ptid) != nullptr;
return targ->find_thread (ptid) != nullptr;
}
/* Finds the first thread of the inferior. */
@@ -1333,7 +1322,7 @@ switch_to_thread (thread_info *thr)
void
switch_to_thread (process_stratum_target *proc_target, ptid_t ptid)
{
thread_info *thr = find_thread_ptid (proc_target, ptid);
thread_info *thr = proc_target->find_thread (ptid);
switch_to_thread (thr);
}