diff options
Diffstat (limited to 'gdb/aix-thread.c')
-rw-r--r-- | gdb/aix-thread.c | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c index f2c5605..1e3015d 100644 --- a/gdb/aix-thread.c +++ b/gdb/aix-thread.c @@ -1,6 +1,6 @@ /* Low level interface for debugging AIX 4.3+ pthreads. - Copyright (C) 1999-2024 Free Software Foundation, Inc. + Copyright (C) 1999-2025 Free Software Foundation, Inc. Written by Nick Duffek <nsd@redhat.com>. This file is part of GDB. @@ -376,7 +376,6 @@ pid_to_prc (ptid_t *ptidp) static int pdc_symbol_addrs (pthdb_user_t user_current_pid, pthdb_symbol_t *symbols, int count) { - struct bound_minimal_symbol ms; int i; char *name; @@ -396,7 +395,8 @@ pdc_symbol_addrs (pthdb_user_t user_current_pid, pthdb_symbol_t *symbols, int co symbols[i].addr = 0; else { - ms = lookup_minimal_symbol (name, NULL, NULL); + bound_minimal_symbol ms + = lookup_minimal_symbol (current_program_space, name); if (ms.minsym == NULL) { if (debug_aix_thread) @@ -854,7 +854,7 @@ sync_threadlists (pid_t pid) thread exits and gets into a PST_UNKNOWN state. So this thread will not run in the above for loop. Therefore the below for loop is to manually delete such threads. */ - for (struct thread_info *it : all_threads ()) + for (struct thread_info *it : all_threads_safe ()) { aix_thread_info *priv = get_aix_thread_info (it); if (in_queue_threads.count (priv->pdtid) == 0 @@ -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 @@ -956,7 +949,6 @@ pd_enable (inferior *inf) { int status; char *stub_name; - struct bound_minimal_symbol ms; struct aix_thread_variables *data; if (inf == NULL) @@ -980,7 +972,8 @@ pd_enable (inferior *inf) return; /* Set a breakpoint on the returned stub function. */ - ms = lookup_minimal_symbol (stub_name, NULL, NULL); + bound_minimal_symbol ms + = lookup_minimal_symbol (current_program_space, stub_name); if (ms.minsym == NULL) return; data->pd_brk_addr = ms.value_address (); @@ -2069,9 +2062,7 @@ aix_thread_target::get_ada_task_ptid (long lwp, ULONGEST thread) /* Module startup initialization function, automagically called by init.c. */ -void _initialize_aix_thread (); -void -_initialize_aix_thread () +INIT_GDB_FILE (aix_thread) { /* Notice when object files get loaded and unloaded. */ gdb::observers::new_objfile.attach (new_objfile, "aix-thread"); |