aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/inferiors.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2017-12-02 20:36:34 -0500
committerSimon Marchi <simon.marchi@polymtl.ca>2017-12-02 20:36:34 -0500
commit8dc7b443a6295da4b3d7ba22f3a7695990bf4f39 (patch)
treeb6fb2c9b95430b4ece0058ac220b3d0826cf4f0b /gdb/gdbserver/inferiors.c
parentda25033cd92a60f4462e1468abfabfee02d0b8d9 (diff)
downloadgdb-8dc7b443a6295da4b3d7ba22f3a7695990bf4f39.zip
gdb-8dc7b443a6295da4b3d7ba22f3a7695990bf4f39.tar.gz
gdb-8dc7b443a6295da4b3d7ba22f3a7695990bf4f39.tar.bz2
Remove find_inferior_id
Remove find_inferior_id, replacing its usages with find_thread_ptid. find_thread_ptid was implemented using find_inferior_id, so move the implementation there instead. gdb/gdbserver/ChangeLog: * inferiors.c (find_inferior_id): Remove. (find_thread_ptid): Move implemention from find_inferior_id to here. * inferiors.h (find_inferior_id): Remove. * server.c (handle_status): Use find_thread_ptid. (process_serial_event): Likewise. * thread-db.c (find_one_thread): Likewise. (thread_db_thread_handle): Likewise. * win32-low.c (thread_rec): Likewise. (child_delete_thread): Likewise. (win32_thread_alive): Likewise. (get_child_debug_event): Likewise.
Diffstat (limited to 'gdb/gdbserver/inferiors.c')
-rw-r--r--gdb/gdbserver/inferiors.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/gdb/gdbserver/inferiors.c b/gdb/gdbserver/inferiors.c
index f4101c7..be3f3ef 100644
--- a/gdb/gdbserver/inferiors.c
+++ b/gdb/gdbserver/inferiors.c
@@ -43,16 +43,6 @@ find_inferior (std::list<thread_info *> *thread_list,
}
thread_info *
-find_inferior_id (std::list<thread_info *> *thread_list, ptid_t id)
-{
- gdb_assert (thread_list == &all_threads);
-
- return find_thread ([&] (thread_info *thread) {
- return thread->id == id;
- });
-}
-
-thread_info *
find_inferior_in_random (std::list<thread_info *> *thread_list,
int (*func) (thread_info *, void *),
void *arg)
@@ -120,7 +110,9 @@ get_first_thread (void)
struct thread_info *
find_thread_ptid (ptid_t ptid)
{
- return (struct thread_info *) find_inferior_id (&all_threads, ptid);
+ return find_thread ([&] (thread_info *thread) {
+ return thread->id == ptid;
+ });
}
/* Find a thread associated with the given PROCESS, or NULL if no