diff options
author | Tom Tromey <tom@tromey.com> | 2025-02-25 07:56:55 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2025-03-11 08:39:58 -0600 |
commit | 58984e4ad22ac8bb8774b338625595ad9f6f55e9 (patch) | |
tree | 7136dbef89ee0cb08a72ab01adae76d410467980 /gdb/aix-thread.c | |
parent | d8a30dd2a692053165ff3dfad1e93164180fc974 (diff) | |
download | binutils-58984e4ad22ac8bb8774b338625595ad9f6f55e9.zip binutils-58984e4ad22ac8bb8774b338625595ad9f6f55e9.tar.gz binutils-58984e4ad22ac8bb8774b338625595ad9f6f55e9.tar.bz2 |
Use gdb::function_view in iterate_over_threads
This C++-ifies iterate_over_threads, changing it to accept a
gdb::function_view and to return bool.
Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb/aix-thread.c')
-rw-r--r-- | gdb/aix-thread.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c index 4a050cd..f38d19d 100644 --- a/gdb/aix-thread.c +++ b/gdb/aix-thread.c @@ -867,16 +867,6 @@ sync_threadlists (pid_t pid) } } -/* Iterate_over_threads() callback for locating a thread, using - the TID of its associated kernel thread. */ - -static int -iter_tid (struct thread_info *thread, void *tidp) -{ - const pthdb_tid_t tid = *(pthdb_tid_t *)tidp; - return thread->ptid.lwp () == tid; -} - /* Synchronize libpthdebug's state with the inferior and with GDB, generate a composite process/thread <pid> for the current thread, Return the ptid of the event thread if one can be found, else @@ -906,7 +896,10 @@ pd_update (pid_t pid) tid = get_signaled_thread (pid); if (tid != 0) - thread = iterate_over_threads (iter_tid, &tid); + thread = iterate_over_threads ([&] (struct thread_info *thread) + { + return thread->ptid.lwp () == tid; + }); if (!thread) ptid = ptid_t (pid); else |