diff options
Diffstat (limited to 'gdb/sol-thread.c')
-rw-r--r-- | gdb/sol-thread.c | 42 |
1 files changed, 15 insertions, 27 deletions
diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c index 77740fe..55e1d3e 100644 --- a/gdb/sol-thread.c +++ b/gdb/sol-thread.c @@ -1,6 +1,6 @@ /* Solaris threads debugging interface. - Copyright (C) 1996-2024 Free Software Foundation, Inc. + Copyright (C) 1996-2025 Free Software Foundation, Inc. This file is part of GDB. @@ -759,9 +759,8 @@ ps_err_e ps_pglobal_lookup (struct ps_prochandle *ph, const char *ld_object_name, const char *ld_symbol_name, psaddr_t *ld_symbol_addr) { - struct bound_minimal_symbol ms; - - ms = lookup_minimal_symbol (ld_symbol_name, NULL, NULL); + bound_minimal_symbol ms + = lookup_minimal_symbol (current_program_space, ld_symbol_name); if (!ms.minsym) return PS_NOSYM; @@ -1068,7 +1067,7 @@ info_cb (const td_thrhandle_t *th, void *s) /* Print thr_create start function. */ if (ti.ti_startfunc != 0) { - const struct bound_minimal_symbol msym + const bound_minimal_symbol msym = lookup_minimal_symbol_by_pc (ti.ti_startfunc); gdb_printf (" startfunc=%s", @@ -1081,7 +1080,7 @@ info_cb (const td_thrhandle_t *th, void *s) /* If thread is asleep, print function that went to sleep. */ if (ti.ti_state == TD_THR_SLEEP) { - const struct bound_minimal_symbol msym + const bound_minimal_symbol msym = lookup_minimal_symbol_by_pc (ti.ti_pc); gdb_printf (" sleepfunc=%s", @@ -1109,33 +1108,24 @@ info_solthreads (const char *args, int from_tty) TD_SIGNO_MASK, TD_THR_ANY_USER_FLAGS); } -/* Callback routine used to find a thread based on the TID part of - its PTID. */ - -static int -thread_db_find_thread_from_tid (struct thread_info *thread, void *data) -{ - ULONGEST *tid = (ULONGEST *) data; - - if (thread->ptid.tid () == *tid) - return 1; - - return 0; -} - ptid_t sol_thread_target::get_ada_task_ptid (long lwp, ULONGEST thread) { - struct thread_info *thread_info = - iterate_over_threads (thread_db_find_thread_from_tid, &thread); + auto thread_db_find_thread_from_tid + = [&] (struct thread_info *iter) + { + return iter->ptid.tid () == thread; + }; + + struct thread_info *thread_info + = iterate_over_threads (thread_db_find_thread_from_tid); if (thread_info == NULL) { /* The list of threads is probably not up to date. Find any thread that is missing from the list, and try again. */ update_thread_list (); - thread_info = iterate_over_threads (thread_db_find_thread_from_tid, - &thread); + thread_info = iterate_over_threads (thread_db_find_thread_from_tid); } gdb_assert (thread_info != NULL); @@ -1143,9 +1133,7 @@ sol_thread_target::get_ada_task_ptid (long lwp, ULONGEST thread) return (thread_info->ptid); } -void _initialize_sol_thread (); -void -_initialize_sol_thread () +INIT_GDB_FILE (sol_thread) { void *dlhandle; |