GDB (xrefs)
|
#include "defs.h"
#include <thread.h>
#include <proc_service.h>
#include <thread_db.h>
#include "gdbthread.h"
#include "target.h"
#include "inferior.h"
#include <fcntl.h>
#include "gdb_stat.h"
#include <dlfcn.h>
#include "gdbcmd.h"
#include "gdbcore.h"
#include "regcache.h"
#include "solib.h"
#include "symfile.h"
#include "observer.h"
#include "gdb_string.h"
#include "procfs.h"
#include "gregset.h"
Go to the source code of this file.
Referenced by _initialize_sol_thread().
typedef psaddr_t gdb_ps_addr_t |
Definition at line 715 of file sol-thread.c.
typedef struct ps_prochandle* gdb_ps_prochandle_t |
Definition at line 711 of file sol-thread.c.
typedef void* gdb_ps_read_buf_t |
Definition at line 712 of file sol-thread.c.
typedef size_t gdb_ps_size_t |
Definition at line 714 of file sol-thread.c.
typedef const void* gdb_ps_write_buf_t |
Definition at line 713 of file sol-thread.c.
void _initialize_sol_thread | ( | void | ) |
Definition at line 1233 of file sol-thread.c.
References _, add_cmd(), class_maintenance, complete_target_initialization(), fprintf_unfiltered(), gdb_stderr, info_solthreads(), init_sol_thread_ops(), maintenanceinfolist, observer_attach_new_objfile(), resolve, sol_thread_new_objfile(), sol_thread_ops, td_init(), td_log(), td_ta_delete(), td_ta_get_nthreads(), td_ta_get_ph(), td_ta_map_id2thr(), td_ta_map_lwp2thr(), td_ta_new(), td_ta_thr_iter(), td_ta_tsd_iter(), td_thr_get_info(), td_thr_getfpregs(), td_thr_getgregs(), td_thr_getxregs(), td_thr_getxregsize(), td_thr_setfpregs(), td_thr_setgregs(), td_thr_setprio(), td_thr_setsigpending(), td_thr_setxregs(), td_thr_sigsetmask(), td_thr_tsd(), and td_thr_validate().
static void check_for_thread_db | ( | void | ) | [static] |
Definition at line 576 of file sol-thread.c.
References _, inferior_ptid, lwp_to_thread(), main_ph, main_ta, p_td_init, p_td_ta_new, printf_unfiltered(), ps_prochandle::ptid, ptid_get_pid(), push_target(), sol_thread_active, sol_thread_ops, target_find_new_threads(), td_err_string(), TD_NOLIBTHREAD, TD_OK, and warning().
static int info_cb | ( | const td_thrhandle_t * | th, |
void * | s | ||
) | [static] |
Definition at line 1095 of file sol-thread.c.
References _, lookup_minimal_symbol_by_pc(), bound_minimal_symbol::minsym, p_td_thr_get_info, paddress(), printf_filtered(), SYMBOL_PRINT_NAME, target_gdbarch(), TD_OK, TD_THR_ACTIVE, TD_THR_RUN, TD_THR_SLEEP, TD_THR_STOPPED, TD_THR_STOPPED_ASLEEP, TD_THR_SYSTEM, TD_THR_UNKNOWN, TD_THR_ZOMBIE, td_thrinfo::ti_lid, td_thrinfo::ti_pc, td_thrinfo::ti_startfunc, td_thrinfo::ti_state, td_thrinfo::ti_tid, td_thrinfo::ti_type, and warning().
Referenced by info_solthreads().
static void info_solthreads | ( | char * | args, |
int | from_tty | ||
) | [static] |
Definition at line 1167 of file sol-thread.c.
References info_cb(), main_ta, p_td_ta_thr_iter, TD_SIGNO_MASK, TD_THR_ANY_STATE, TD_THR_ANY_USER_FLAGS, and TD_THR_LOWEST_PRIORITY.
Referenced by _initialize_sol_thread().
static void init_sol_thread_ops | ( | void | ) | [static] |
Definition at line 1209 of file sol-thread.c.
References OPS_MAGIC, sol_find_new_threads(), sol_get_ada_task_ptid(), sol_thread_alive(), sol_thread_detach(), sol_thread_fetch_registers(), sol_thread_mourn_inferior(), sol_thread_ops, sol_thread_resume(), sol_thread_store_registers(), sol_thread_wait(), sol_thread_xfer_partial(), solaris_pid_to_str(), thread_stratum, target_ops::to_detach, target_ops::to_doc, target_ops::to_fetch_registers, target_ops::to_find_new_threads, target_ops::to_get_ada_task_ptid, target_ops::to_longname, target_ops::to_magic, target_ops::to_mourn_inferior, target_ops::to_pid_to_str, target_ops::to_resume, target_ops::to_shortname, target_ops::to_store_registers, target_ops::to_stratum, target_ops::to_thread_alive, target_ops::to_wait, and target_ops::to_xfer_partial.
Referenced by _initialize_sol_thread().
static ptid_t lwp_to_thread | ( | ptid_t | lwp | ) | [static] |
Definition at line 275 of file sol-thread.c.
References _, error(), main_ta, p_td_ta_map_lwp2thr, p_td_thr_get_info, p_td_thr_validate, pid_to_ptid(), ptid_build(), ptid_get_lwp(), ptid_get_pid(), ptid_tid_p(), target_thread_alive(), td_err_string(), TD_NOTHR, TD_OK, and td_thrinfo::ti_tid.
Referenced by check_for_thread_db(), and sol_thread_wait().
ps_err_e ps_lcontinue | ( | gdb_ps_prochandle_t | ph, |
lwpid_t | lwpid | ||
) |
Definition at line 750 of file sol-thread.c.
References PS_OK.
ps_err_e ps_lgetfpregs | ( | gdb_ps_prochandle_t | ph, |
lwpid_t | lwpid, | ||
prfpregset_t * | fpregset | ||
) |
Definition at line 927 of file sol-thread.c.
References do_cleanups(), fill_fpregset(), get_thread_arch_regcache(), inferior_ptid, PS_OK, ptid_build(), ptid_get_pid(), save_inferior_ptid(), target_fetch_registers(), and target_gdbarch().
ps_err_e ps_lgetregs | ( | gdb_ps_prochandle_t | ph, |
lwpid_t | lwpid, | ||
prgregset_t | gregset | ||
) |
Definition at line 848 of file sol-thread.c.
References do_cleanups(), fill_gregset(), get_thread_arch_regcache(), inferior_ptid, PS_OK, ptid_build(), ptid_get_pid(), save_inferior_ptid(), target_fetch_registers(), and target_gdbarch().
ps_err_e ps_lgetxregs | ( | gdb_ps_prochandle_t | ph, |
lwpid_t | lwpid, | ||
caddr_t | xregset | ||
) |
Definition at line 911 of file sol-thread.c.
References PS_OK.
ps_err_e ps_lgetxregsize | ( | gdb_ps_prochandle_t | ph, |
lwpid_t | lwpid, | ||
int * | xregsize | ||
) |
Definition at line 903 of file sol-thread.c.
References PS_OK.
ps_err_e ps_lsetfpregs | ( | gdb_ps_prochandle_t | ph, |
lwpid_t | lwpid, | ||
const prfpregset_t * | fpregset | ||
) |
Definition at line 949 of file sol-thread.c.
References do_cleanups(), get_thread_arch_regcache(), inferior_ptid, PS_OK, ptid_build(), ptid_get_pid(), save_inferior_ptid(), supply_fpregset(), target_gdbarch(), and target_store_registers().
ps_err_e ps_lsetregs | ( | gdb_ps_prochandle_t | ph, |
lwpid_t | lwpid, | ||
const prgregset_t | gregset | ||
) |
Definition at line 869 of file sol-thread.c.
References do_cleanups(), get_thread_arch_regcache(), inferior_ptid, PS_OK, ptid_build(), ptid_get_pid(), save_inferior_ptid(), supply_gregset(), target_gdbarch(), and target_store_registers().
ps_err_e ps_lsetxregs | ( | gdb_ps_prochandle_t | ph, |
lwpid_t | lwpid, | ||
caddr_t | xregset | ||
) |
Definition at line 919 of file sol-thread.c.
References PS_OK.
ps_err_e ps_lstop | ( | gdb_ps_prochandle_t | ph, |
lwpid_t | lwpid | ||
) |
Definition at line 742 of file sol-thread.c.
References PS_OK.
Definition at line 734 of file sol-thread.c.
References PS_OK.
ps_err_e ps_pdread | ( | gdb_ps_prochandle_t | ph, |
gdb_ps_addr_t | addr, | ||
gdb_ps_read_buf_t | buf, | ||
gdb_ps_size_t | size | ||
) |
Definition at line 812 of file sol-thread.c.
References rw_common().
ps_err_e ps_pdwrite | ( | gdb_ps_prochandle_t | ph, |
gdb_ps_addr_t | addr, | ||
gdb_ps_write_buf_t | buf, | ||
gdb_ps_size_t | size | ||
) |
Definition at line 821 of file sol-thread.c.
References rw_common().
ps_err_e ps_pglobal_lookup | ( | gdb_ps_prochandle_t | ph, |
const char * | ld_object_name, | ||
const char * | ld_symbol_name, | ||
gdb_ps_addr_t * | ld_symbol_addr | ||
) |
Definition at line 758 of file sol-thread.c.
References lookup_minimal_symbol(), PS_NOSYM, PS_OK, and SYMBOL_VALUE_ADDRESS.
Definition at line 891 of file sol-thread.c.
References gdb_stderr, and vfprintf_filtered().
Definition at line 726 of file sol-thread.c.
References PS_OK.
ps_err_e ps_ptread | ( | gdb_ps_prochandle_t | ph, |
gdb_ps_addr_t | addr, | ||
gdb_ps_read_buf_t | buf, | ||
gdb_ps_size_t | size | ||
) |
Definition at line 830 of file sol-thread.c.
References rw_common().
ps_err_e ps_ptwrite | ( | gdb_ps_prochandle_t | ph, |
gdb_ps_addr_t | addr, | ||
gdb_ps_write_buf_t | buf, | ||
gdb_ps_size_t | size | ||
) |
Definition at line 839 of file sol-thread.c.
References rw_common().
static ps_err_e rw_common | ( | int | dowrite, |
const struct ps_prochandle * | ph, | ||
gdb_ps_addr_t | addr, | ||
gdb_byte * | buf, | ||
int | size | ||
) | [static] |
Definition at line 774 of file sol-thread.c.
References do_cleanups(), exec_bfd, inferior_ptid, procfs_first_available(), PS_ERR, PS_OK, ptid_tid_p(), save_inferior_ptid(), target_read_memory(), target_thread_alive(), and target_write_memory().
Referenced by ps_pdread(), ps_pdwrite(), ps_ptread(), and ps_ptwrite().
static void sol_find_new_threads | ( | struct target_ops * | ops | ) | [static] |
Definition at line 1075 of file sol-thread.c.
References target_ops::beneath, find_target_beneath(), main_ta, p_td_ta_thr_iter, sol_find_new_threads_callback(), TD_SIGNO_MASK, TD_THR_ANY_STATE, TD_THR_ANY_USER_FLAGS, TD_THR_LOWEST_PRIORITY, and target_ops::to_find_new_threads.
Referenced by init_sol_thread_ops(), and sol_get_ada_task_ptid().
static int sol_find_new_threads_callback | ( | const td_thrhandle_t * | th, |
void * | ignored | ||
) | [static] |
Definition at line 1057 of file sol-thread.c.
References add_thread(), in_thread_list(), inferior_ptid, is_exited(), p_td_thr_get_info, ptid_build(), ptid_get_pid(), TD_OK, and td_thrinfo::ti_tid.
Referenced by sol_find_new_threads().
static ptid_t sol_get_ada_task_ptid | ( | long | lwp, |
long | thread | ||
) | [static] |
Definition at line 1189 of file sol-thread.c.
References current_target, gdb_assert, iterate_over_threads(), thread_info::ptid, sol_find_new_threads(), and thread_db_find_thread_from_tid().
Referenced by init_sol_thread_ops().
static int sol_thread_alive | ( | struct target_ops * | ops, |
ptid_t | ptid | ||
) | [static] |
Definition at line 661 of file sol-thread.c.
References target_ops::beneath, find_target_beneath(), main_ta, p_td_ta_map_id2thr, p_td_thr_validate, ptid_get_tid(), ptid_tid_p(), TD_OK, and target_ops::to_thread_alive.
Referenced by init_sol_thread_ops().
static void sol_thread_detach | ( | struct target_ops * | ops, |
char * | args, | ||
int | from_tty | ||
) | [static] |
Definition at line 323 of file sol-thread.c.
References target_ops::beneath, find_target_beneath(), inferior_ptid, main_ph, pid_to_ptid(), ps_prochandle::ptid, ptid_get_pid(), sol_thread_active, target_ops::to_detach, and unpush_target().
Referenced by init_sol_thread_ops().
static void sol_thread_fetch_registers | ( | struct target_ops * | ops, |
struct regcache * | regcache, | ||
int | regnum | ||
) | [static] |
Definition at line 426 of file sol-thread.c.
References _, target_ops::beneath, error(), find_target_beneath(), inferior_ptid, main_ta, p_td_ta_map_id2thr, p_td_thr_getfpregs, p_td_thr_getgregs, ptid_get_tid(), ptid_tid_p(), supply_fpregset(), supply_gregset(), td_err_string(), TD_NOFPREGS, TD_OK, TD_PARTIALREG, and target_ops::to_fetch_registers.
Referenced by init_sol_thread_ops().
static void sol_thread_mourn_inferior | ( | struct target_ops * | ops | ) | [static] |
Definition at line 647 of file sol-thread.c.
References target_ops::beneath, find_target_beneath(), sol_thread_active, target_ops::to_mourn_inferior, and unpush_target().
Referenced by init_sol_thread_ops().
static void sol_thread_new_objfile | ( | struct objfile * | objfile | ) | [static] |
Definition at line 638 of file sol-thread.c.
References check_for_thread_db().
Referenced by _initialize_sol_thread().
static void sol_thread_resume | ( | struct target_ops * | ops, |
ptid_t | ptid, | ||
int | step, | ||
enum gdb_signal | signo | ||
) | [static] |
Definition at line 339 of file sol-thread.c.
References _, target_ops::beneath, do_cleanups(), error(), find_target_beneath(), inferior_ptid, info_verbose, main_ph, procfs_first_available(), ps_prochandle::ptid, ptid_get_pid(), ptid_get_tid(), save_inferior_ptid(), thread_to_lwp(), target_ops::to_resume, and warning().
Referenced by init_sol_thread_ops().
static void sol_thread_store_registers | ( | struct target_ops * | ops, |
struct regcache * | regcache, | ||
int | regnum | ||
) | [static] |
Definition at line 481 of file sol-thread.c.
References _, target_ops::beneath, error(), fill_fpregset(), fill_gregset(), find_target_beneath(), inferior_ptid, main_ta, MAX_REGISTER_SIZE, p_td_ta_map_id2thr, p_td_thr_getfpregs, p_td_thr_getgregs, p_td_thr_setfpregs, p_td_thr_setgregs, ptid_get_tid(), ptid_tid_p(), regcache_raw_collect(), regcache_raw_supply(), td_err_string(), TD_OK, and target_ops::to_store_registers.
Referenced by init_sol_thread_ops().
static ptid_t sol_thread_wait | ( | struct target_ops * | ops, |
ptid_t | ptid, | ||
struct target_waitstatus * | ourstatus, | ||
int | options | ||
) | [static] |
Definition at line 372 of file sol-thread.c.
References _, add_thread(), target_ops::beneath, do_cleanups(), error(), find_target_beneath(), in_thread_list(), inferior_ptid, info_verbose, is_exited(), target_waitstatus::kind, lwp_to_thread(), main_ph, procfs_first_available(), ps_prochandle::ptid, ptid_equal(), ptid_get_pid(), ptid_get_tid(), ptid_tid_p(), save_inferior_ptid(), TARGET_WAITKIND_EXITED, thread_to_lwp(), target_ops::to_wait, and warning().
Referenced by init_sol_thread_ops().
static LONGEST sol_thread_xfer_partial | ( | struct target_ops * | ops, |
enum target_object | object, | ||
const char * | annex, | ||
gdb_byte * | readbuf, | ||
const gdb_byte * | writebuf, | ||
ULONGEST | offset, | ||
LONGEST | len | ||
) | [static] |
Definition at line 546 of file sol-thread.c.
References target_ops::beneath, do_cleanups(), find_target_beneath(), inferior_ptid, procfs_first_available(), ptid_tid_p(), save_inferior_ptid(), target_thread_alive(), and target_ops::to_xfer_partial.
Referenced by init_sol_thread_ops().
static char* solaris_pid_to_str | ( | struct target_ops * | ops, |
ptid_t | ptid | ||
) | [static] |
Definition at line 1024 of file sol-thread.c.
References ptid_get_lwp(), ptid_get_pid(), ptid_get_tid(), ptid_tid_p(), thread_to_lwp(), and xsnprintf().
Referenced by init_sol_thread_ops().
static char* td_err_string | ( | td_err_e | errcode | ) | [static] |
Definition at line 155 of file sol-thread.c.
References string_map::num, string_map::str, TD_BADKEY, TD_BADPH, TD_BADSH, TD_BADTA, TD_BADTH, TD_DBERR, TD_ERR, TD_MALLOC, TD_NOAPLIC, TD_NOCAPAB, TD_NOEVENT, TD_NOFPREGS, TD_NOLIBTHREAD, TD_NOLWP, TD_NOMSG, TD_NOSV, TD_NOTHR, TD_NOTSD, TD_NOXREGS, TD_OK, TD_PARTIALREG, and xsnprintf().
Referenced by check_for_thread_db(), lwp_to_thread(), sol_thread_fetch_registers(), sol_thread_store_registers(), and thread_to_lwp().
static char* td_state_string | ( | td_thr_state_e | statecode | ) | [static] |
Definition at line 199 of file sol-thread.c.
References string_map::num, string_map::str, TD_THR_ACTIVE, TD_THR_ANY_STATE, TD_THR_RUN, TD_THR_SLEEP, TD_THR_STOPPED, TD_THR_STOPPED_ASLEEP, TD_THR_UNKNOWN, TD_THR_ZOMBIE, and xsnprintf().
Referenced by thread_to_lwp().
static int thread_db_find_thread_from_tid | ( | struct thread_info * | thread, |
void * | data | ||
) | [static] |
Definition at line 1178 of file sol-thread.c.
References thread_info::ptid, and ptid_get_tid().
Referenced by sol_get_ada_task_ptid().
static ptid_t thread_to_lwp | ( | ptid_t | thread_id, |
int | default_lwp | ||
) | [static] |
Definition at line 235 of file sol-thread.c.
References _, error(), main_ta, p_td_ta_map_id2thr, p_td_thr_get_info, pid_to_ptid(), ptid_build(), ptid_get_pid(), ptid_get_tid(), ptid_lwp_p(), td_err_string(), TD_NOTHR, TD_OK, td_state_string(), TD_THR_ACTIVE, td_thrinfo::ti_lid, and td_thrinfo::ti_state.
Referenced by sol_thread_resume(), sol_thread_wait(), and solaris_pid_to_str().
struct ps_prochandle main_ph [static] |
Definition at line 90 of file sol-thread.c.
Referenced by check_for_thread_db(), sol_thread_detach(), sol_thread_resume(), and sol_thread_wait().
td_thragent_t* main_ta [static] |
Definition at line 91 of file sol-thread.c.
Referenced by check_for_thread_db(), info_solthreads(), lwp_to_thread(), sol_find_new_threads(), sol_thread_alive(), sol_thread_fetch_registers(), sol_thread_store_registers(), and thread_to_lwp().
Definition at line 105 of file sol-thread.c.
Referenced by check_for_thread_db().
Definition at line 101 of file sol-thread.c.
td_err_e(* p_td_ta_delete)(td_thragent_t *ta_p) [static] |
Definition at line 104 of file sol-thread.c.
td_err_e(* p_td_ta_get_nthreads)(const td_thragent_t *ta_p, int *nthread_p) [static] |
Definition at line 108 of file sol-thread.c.
td_err_e(* p_td_ta_get_ph)(const td_thragent_t *ta_p, struct ps_prochandle **ph_pp) [static] |
Definition at line 106 of file sol-thread.c.
td_err_e(* p_td_ta_map_id2thr)(const td_thragent_t *ta_p, thread_t tid, td_thrhandle_t *th_p) [static] |
Definition at line 139 of file sol-thread.c.
Referenced by sol_thread_alive(), sol_thread_fetch_registers(), sol_thread_store_registers(), and thread_to_lwp().
td_err_e(* p_td_ta_map_lwp2thr)(const td_thragent_t *ta_p, lwpid_t lwpid, td_thrhandle_t *th_p) [static] |
Definition at line 142 of file sol-thread.c.
Referenced by lwp_to_thread().
td_err_e(* p_td_ta_new)(const struct ps_prochandle *ph_p, td_thragent_t **ta_pp) [static] |
Definition at line 102 of file sol-thread.c.
Referenced by check_for_thread_db().
td_err_e(* p_td_ta_thr_iter)(const td_thragent_t *ta_p, td_thr_iter_f *cb, void *cbdata_p, td_thr_state_e state, int ti_pri, sigset_t *ti_sigmask_p, unsigned ti_user_flags) [static] |
Definition at line 112 of file sol-thread.c.
Referenced by info_solthreads(), and sol_find_new_threads().
td_err_e(* p_td_ta_tsd_iter)(const td_thragent_t *ta_p, td_key_iter_f *cb, void *cbdata_p) [static] |
Definition at line 110 of file sol-thread.c.
td_err_e(* p_td_thr_get_info)(const td_thrhandle_t *th_p, td_thrinfo_t *ti_p) [static] |
Definition at line 120 of file sol-thread.c.
Referenced by info_cb(), lwp_to_thread(), sol_find_new_threads_callback(), and thread_to_lwp().
td_err_e(* p_td_thr_getfpregs)(const td_thrhandle_t *th_p, prfpregset_t *fpregset) [static] |
Definition at line 122 of file sol-thread.c.
Referenced by sol_thread_fetch_registers(), and sol_thread_store_registers().
td_err_e(* p_td_thr_getgregs)(const td_thrhandle_t *th_p, prgregset_t regset) [static] |
Definition at line 145 of file sol-thread.c.
Referenced by sol_thread_fetch_registers(), and sol_thread_store_registers().
td_err_e(* p_td_thr_getxregs)(const td_thrhandle_t *th_p, const caddr_t xregset) [static] |
Definition at line 126 of file sol-thread.c.
td_err_e(* p_td_thr_getxregsize)(const td_thrhandle_t *th_p, int *xregsize) [static] |
Definition at line 124 of file sol-thread.c.
td_err_e(* p_td_thr_setfpregs)(const td_thrhandle_t *th_p, const prfpregset_t *fpregset) [static] |
Definition at line 135 of file sol-thread.c.
Referenced by sol_thread_store_registers().
td_err_e(* p_td_thr_setgregs)(const td_thrhandle_t *th_p, const prgregset_t regset) [static] |
Definition at line 147 of file sol-thread.c.
Referenced by sol_thread_store_registers().
td_err_e(* p_td_thr_setprio)(const td_thrhandle_t *th_p, const int ti_pri) [static] |
Definition at line 130 of file sol-thread.c.
td_err_e(* p_td_thr_setsigpending)(const td_thrhandle_t *th_p, const uchar_t ti_pending_flag, const sigset_t ti_pending) [static] |
Definition at line 132 of file sol-thread.c.
td_err_e(* p_td_thr_setxregs)(const td_thrhandle_t *th_p, const caddr_t xregset) [static] |
Definition at line 137 of file sol-thread.c.
td_err_e(* p_td_thr_sigsetmask)(const td_thrhandle_t *th_p, const sigset_t ti_sigmask) [static] |
Definition at line 128 of file sol-thread.c.
td_err_e(* p_td_thr_tsd)(const td_thrhandle_t *th_p, const thread_key_t key, void **data_pp) [static] |
Definition at line 118 of file sol-thread.c.
td_err_e(* p_td_thr_validate)(const td_thrhandle_t *th_p) [static] |
Definition at line 117 of file sol-thread.c.
Referenced by lwp_to_thread(), and sol_thread_alive().
int sol_thread_active = 0 [static] |
Definition at line 92 of file sol-thread.c.
Referenced by check_for_thread_db(), sol_thread_detach(), and sol_thread_mourn_inferior().
struct target_ops sol_thread_ops |
Definition at line 70 of file sol-thread.c.
Referenced by _initialize_sol_thread(), check_for_thread_db(), and init_sol_thread_ops().