gdbserver: remove for_each_thread(pid, func)

Remove this overload, prefer to use `process_info::for_each_thread`.  In
many instances, the `process_info` is already available, so this saves a
map lookup.  In other instances, add the `process_info` lookup at the
call site.

In `linux-arm-low.cc` and `win32-i386-low.cc`, use `current_process ()`
instead of `current_thread->id.pid ()`.  I presume that if
`current_process ()` and `current_thread` don't match, it's a bug
orthogonal to this change.

Change-Id: I751ed497cb1f313cf937b35125151bee9316fc51
Reviewed-By: Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
This commit is contained in:
Simon Marchi
2024-11-06 13:39:48 -05:00
parent 6672ccafd9
commit 3470a0e144
8 changed files with 24 additions and 33 deletions

View File

@@ -116,10 +116,6 @@ thread_info *find_thread (ptid_t filter,
void for_each_thread (gdb::function_view<void (thread_info *)> func);
/* Like the above, but only consider threads with pid PID. */
void for_each_thread (int pid, gdb::function_view<void (thread_info *)> func);
/* Like the above, but only consider threads matching PTID. */
void for_each_thread