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 <sys/stat.h>
#include <dlfcn.h>
#include "gdbcmd.h"
#include "gdbcore.h"
#include "regcache.h"
#include "solib.h"
#include "symfile.h"
#include "observable.h"
#include "procfs.h"
#include "symtab.h"
#include "minsyms.h"
#include "objfiles.h"
#include "gregset.h"
Go to the source code of this file.
Classes | |
class | sol_thread_target |
struct | ps_prochandle |
struct | string_map |
Macros | |
#define | resolve(X) |
Functions | |
static const char * | td_err_string (td_err_e errcode) |
static const char * | td_state_string (td_thr_state_e statecode) |
static ptid_t | thread_to_lwp (ptid_t thread_id, int default_lwp) |
static ptid_t | lwp_to_thread (ptid_t lwp) |
static void | check_for_thread_db (void) |
static void | sol_thread_new_objfile (struct objfile *objfile) |
ps_err_e | ps_pstop (struct ps_prochandle *ph) |
ps_err_e | ps_pcontinue (struct ps_prochandle *ph) |
ps_err_e | ps_lstop (struct ps_prochandle *ph, lwpid_t lwpid) |
ps_err_e | ps_lcontinue (struct ps_prochandle *ph, lwpid_t lwpid) |
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) |
static ps_err_e | rw_common (int dowrite, const struct ps_prochandle *ph, psaddr_t addr, gdb_byte *buf, int size) |
ps_err_e | ps_pdread (struct ps_prochandle *ph, psaddr_t addr, void *buf, size_t size) |
ps_err_e | ps_pdwrite (struct ps_prochandle *ph, psaddr_t addr, const void *buf, size_t size) |
ps_err_e | ps_ptread (struct ps_prochandle *ph, psaddr_t addr, void *buf, size_t size) |
ps_err_e | ps_ptwrite (struct ps_prochandle *ph, psaddr_t addr, const void *buf, size_t size) |
ps_err_e | ps_lgetregs (struct ps_prochandle *ph, lwpid_t lwpid, prgregset_t gregset) |
ps_err_e | ps_lsetregs (struct ps_prochandle *ph, lwpid_t lwpid, const prgregset_t gregset) |
void | ps_plog (const char *fmt,...) |
ps_err_e | ps_lgetxregsize (struct ps_prochandle *ph, lwpid_t lwpid, int *xregsize) |
ps_err_e | ps_lgetxregs (struct ps_prochandle *ph, lwpid_t lwpid, caddr_t xregset) |
ps_err_e | ps_lsetxregs (struct ps_prochandle *ph, lwpid_t lwpid, caddr_t xregset) |
ps_err_e | ps_lgetfpregs (struct ps_prochandle *ph, lwpid_t lwpid, prfpregset_t *fpregset) |
ps_err_e | ps_lsetfpregs (struct ps_prochandle *ph, lwpid_t lwpid, const prfpregset_t *fpregset) |
ps_err_e | ps_pdmodel (struct ps_prochandle *ph, int *data_model) |
static int | sol_update_thread_list_callback (const td_thrhandle_t *th, void *ignored) |
static int | info_cb (const td_thrhandle_t *th, void *s) |
static void | info_solthreads (const char *args, int from_tty) |
static int | thread_db_find_thread_from_tid (struct thread_info *thread, void *data) |
void | _initialize_sol_thread () |
#define resolve | ( | X | ) |
typedef td_err_e td_init_ftype(void) |
Definition at line 140 of file sol-thread.c.
typedef void td_log_ftype(const int on_off) |
Definition at line 136 of file sol-thread.c.
typedef td_err_e td_ta_delete_ftype(td_thragent_t *ta_p) |
Definition at line 139 of file sol-thread.c.
typedef td_err_e td_ta_get_nthreads_ftype(const td_thragent_t *ta_p, int *nthread_p) |
Definition at line 143 of file sol-thread.c.
typedef td_err_e td_ta_get_ph_ftype(const td_thragent_t *ta_p, struct ps_prochandle **ph_pp) |
Definition at line 141 of file sol-thread.c.
typedef td_err_e td_ta_map_id2thr_ftype(const td_thragent_t *ta_p, thread_t tid, td_thrhandle_t *th_p) |
Definition at line 174 of file sol-thread.c.
typedef td_err_e td_ta_map_lwp2thr_ftype(const td_thragent_t *ta_p, lwpid_t lwpid, td_thrhandle_t *th_p) |
Definition at line 177 of file sol-thread.c.
typedef td_err_e td_ta_new_ftype(const struct ps_prochandle *ph_p, td_thragent_t **ta_pp) |
Definition at line 137 of file sol-thread.c.
typedef td_err_e td_ta_thr_iter_ftype(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) |
Definition at line 147 of file sol-thread.c.
typedef td_err_e td_ta_tsd_iter_ftype(const td_thragent_t *ta_p, td_key_iter_f *cb, void *cbdata_p) |
Definition at line 145 of file sol-thread.c.
typedef td_err_e td_thr_get_info_ftype(const td_thrhandle_t *th_p, td_thrinfo_t *ti_p) |
Definition at line 155 of file sol-thread.c.
typedef td_err_e td_thr_getfpregs_ftype(const td_thrhandle_t *th_p, prfpregset_t *fpregset) |
Definition at line 157 of file sol-thread.c.
typedef td_err_e td_thr_getgregs_ftype(const td_thrhandle_t *th_p, prgregset_t regset) |
Definition at line 180 of file sol-thread.c.
typedef td_err_e td_thr_getxregs_ftype(const td_thrhandle_t *th_p, const caddr_t xregset) |
Definition at line 161 of file sol-thread.c.
typedef td_err_e td_thr_getxregsize_ftype(const td_thrhandle_t *th_p, int *xregsize) |
Definition at line 159 of file sol-thread.c.
typedef td_err_e td_thr_setfpregs_ftype(const td_thrhandle_t *th_p, const prfpregset_t *fpregset) |
Definition at line 170 of file sol-thread.c.
typedef td_err_e td_thr_setgregs_ftype(const td_thrhandle_t *th_p, const prgregset_t regset) |
Definition at line 182 of file sol-thread.c.
typedef td_err_e td_thr_setprio_ftype(const td_thrhandle_t *th_p, const int ti_pri) |
Definition at line 165 of file sol-thread.c.
typedef td_err_e td_thr_setsigpending_ftype(const td_thrhandle_t *th_p, const uchar_t ti_pending_flag, const sigset_t ti_pending) |
Definition at line 167 of file sol-thread.c.
typedef td_err_e td_thr_setxregs_ftype(const td_thrhandle_t *th_p, const caddr_t xregset) |
Definition at line 172 of file sol-thread.c.
typedef td_err_e td_thr_sigsetmask_ftype(const td_thrhandle_t *th_p, const sigset_t ti_sigmask) |
Definition at line 163 of file sol-thread.c.
typedef td_err_e td_thr_tsd_ftype(const td_thrhandle_t *th_p, const thread_key_t key, void **data_pp) |
Definition at line 153 of file sol-thread.c.
typedef td_err_e td_thr_validate_ftype(const td_thrhandle_t *th_p) |
Definition at line 152 of file sol-thread.c.
void _initialize_sol_thread | ( | ) |
Definition at line 1152 of file sol-thread.c.
References add_cmd(), class_maintenance, gdb_printf(), gdb_stderr, info_solthreads(), maintenanceinfolist, gdb::observers::new_objfile, resolve, sol_thread_new_objfile(), 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 |
Definition at line 603 of file sol-thread.c.
References core_bfd, current_inferior(), err, gdb_printf(), inferior_ptid, lwp_to_thread(), main_ph, main_ta, p_td_init, p_td_ta_new, ps_prochandle::ptid, inferior::push_target(), sol_thread_active, sol_thread_ops, target_can_run(), target_update_thread_list(), td_err_string(), TD_NOLIBTHREAD, and TD_OK.
Referenced by sol_thread_new_objfile().
|
static |
Definition at line 1037 of file sol-thread.c.
References gdb_printf(), lookup_minimal_symbol_by_pc(), bound_minimal_symbol::minsym, p_td_thr_get_info, paddress(), general_symbol_info::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, and td_thrinfo::ti_type.
Referenced by info_solthreads().
|
static |
Definition at line 1109 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 |
Definition at line 336 of file sol-thread.c.
References main_ta, p_td_ta_map_lwp2thr, p_td_thr_get_info, p_td_thr_validate, target_thread_alive(), td_err_string(), TD_NOTHR, TD_OK, and td_thrinfo::ti_tid.
Referenced by check_for_thread_db(), and sol_thread_target::wait().
ps_err_e ps_lcontinue | ( | struct ps_prochandle * | ph, |
lwpid_t | lwpid ) |
Definition at line 752 of file sol-thread.c.
ps_err_e ps_lgetfpregs | ( | struct ps_prochandle * | ph, |
lwpid_t | lwpid, | ||
prfpregset_t * | fpregset ) |
Definition at line 914 of file sol-thread.c.
References current_inferior(), fill_fpregset(), get_thread_arch_regcache(), pid, regcache::ptid(), target_fetch_registers(), and target_gdbarch().
ps_err_e ps_lgetregs | ( | struct ps_prochandle * | ph, |
lwpid_t | lwpid, | ||
prgregset_t | gregset ) |
Definition at line 845 of file sol-thread.c.
References current_inferior(), fill_gregset(), get_thread_arch_regcache(), pid, regcache::ptid(), target_fetch_registers(), and target_gdbarch().
ps_err_e ps_lgetxregs | ( | struct ps_prochandle * | ph, |
lwpid_t | lwpid, | ||
caddr_t | xregset ) |
Definition at line 898 of file sol-thread.c.
ps_err_e ps_lgetxregsize | ( | struct ps_prochandle * | ph, |
lwpid_t | lwpid, | ||
int * | xregsize ) |
Definition at line 890 of file sol-thread.c.
ps_err_e ps_lsetfpregs | ( | struct ps_prochandle * | ph, |
lwpid_t | lwpid, | ||
const prfpregset_t * | fpregset ) |
Definition at line 931 of file sol-thread.c.
References current_inferior(), get_thread_arch_regcache(), pid, regcache::ptid(), supply_fpregset(), target_gdbarch(), and target_store_registers().
ps_err_e ps_lsetregs | ( | struct ps_prochandle * | ph, |
lwpid_t | lwpid, | ||
const prgregset_t | gregset ) |
Definition at line 861 of file sol-thread.c.
References current_inferior(), get_thread_arch_regcache(), pid, regcache::ptid(), supply_gregset(), target_gdbarch(), and target_store_registers().
ps_err_e ps_lsetxregs | ( | struct ps_prochandle * | ph, |
lwpid_t | lwpid, | ||
caddr_t | xregset ) |
Definition at line 906 of file sol-thread.c.
ps_err_e ps_lstop | ( | struct ps_prochandle * | ph, |
lwpid_t | lwpid ) |
Definition at line 744 of file sol-thread.c.
ps_err_e ps_pcontinue | ( | struct ps_prochandle * | ph | ) |
Definition at line 736 of file sol-thread.c.
ps_err_e ps_pdmodel | ( | struct ps_prochandle * | ph, |
int * | data_model ) |
Definition at line 950 of file sol-thread.c.
References current_program_space, and program_space::exec_bfd().
ps_err_e ps_pdread | ( | struct ps_prochandle * | ph, |
psaddr_t | addr, | ||
void * | buf, | ||
size_t | size ) |
Definition at line 811 of file sol-thread.c.
References rw_common(), and size.
ps_err_e ps_pdwrite | ( | struct ps_prochandle * | ph, |
psaddr_t | addr, | ||
const void * | buf, | ||
size_t | size ) |
Definition at line 819 of file sol-thread.c.
References rw_common(), and size.
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 ) |
Definition at line 760 of file sol-thread.c.
References lookup_minimal_symbol(), bound_minimal_symbol::minsym, and bound_minimal_symbol::value_address().
void ps_plog | ( | const char * | fmt, |
... ) |
Definition at line 878 of file sol-thread.c.
References gdb_stderr, and gdb_vprintf().
ps_err_e ps_pstop | ( | struct ps_prochandle * | ph | ) |
Definition at line 728 of file sol-thread.c.
ps_err_e ps_ptread | ( | struct ps_prochandle * | ph, |
psaddr_t | addr, | ||
void * | buf, | ||
size_t | size ) |
Definition at line 828 of file sol-thread.c.
References rw_common(), and size.
ps_err_e ps_ptwrite | ( | struct ps_prochandle * | ph, |
psaddr_t | addr, | ||
const void * | buf, | ||
size_t | size ) |
Definition at line 836 of file sol-thread.c.
References rw_common(), and size.
|
static |
Definition at line 776 of file sol-thread.c.
References current_program_space, program_space::exec_bfd(), inferior_ptid, procfs_first_available(), size, target_read_memory(), target_thread_alive(), and target_write_memory().
Referenced by ps_pdread(), ps_pdwrite(), ps_ptread(), and ps_ptwrite().
|
static |
Definition at line 669 of file sol-thread.c.
References check_for_thread_db().
Referenced by _initialize_sol_thread().
|
static |
Definition at line 995 of file sol-thread.c.
References add_thread(), current_inferior(), inferior::find_thread(), p_td_thr_get_info, pid, inferior::process_target(), regcache::ptid(), thread_info::state, TD_OK, THREAD_EXITED, and td_thrinfo::ti_tid.
Referenced by sol_thread_target::update_thread_list().
|
static |
Definition at line 216 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, and TD_PARTIALREG.
Referenced by check_for_thread_db(), sol_thread_target::fetch_registers(), lwp_to_thread(), sol_thread_target::store_registers(), and thread_to_lwp().
|
static |
Definition at line 260 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, and TD_THR_ZOMBIE.
Referenced by thread_to_lwp().
|
static |
Definition at line 1120 of file sol-thread.c.
References thread_info::ptid.
Referenced by sol_thread_target::get_ada_task_ptid().
|
static |
Definition at line 296 of file sol-thread.c.
References main_ta, p_td_ta_map_id2thr, p_td_thr_get_info, 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_target::pid_to_str(), sol_thread_target::resume(), and sol_thread_target::wait().
|
static |
Definition at line 127 of file sol-thread.c.
Referenced by check_for_thread_db(), sol_thread_target::detach(), and sol_thread_target::resume().
|
static |
Definition at line 128 of file sol-thread.c.
Referenced by check_for_thread_db(), sol_thread_target::fetch_registers(), info_solthreads(), lwp_to_thread(), sol_thread_target::store_registers(), sol_thread_target::thread_alive(), thread_to_lwp(), and sol_thread_target::update_thread_list().
|
static |
Definition at line 190 of file sol-thread.c.
Referenced by check_for_thread_db().
|
static |
Definition at line 187 of file sol-thread.c.
|
static |
Definition at line 189 of file sol-thread.c.
|
static |
Definition at line 192 of file sol-thread.c.
|
static |
Definition at line 191 of file sol-thread.c.
|
static |
Definition at line 206 of file sol-thread.c.
Referenced by sol_thread_target::fetch_registers(), sol_thread_target::store_registers(), sol_thread_target::thread_alive(), and thread_to_lwp().
|
static |
Definition at line 207 of file sol-thread.c.
Referenced by lwp_to_thread().
|
static |
Definition at line 188 of file sol-thread.c.
Referenced by check_for_thread_db().
|
static |
Definition at line 194 of file sol-thread.c.
Referenced by info_solthreads(), and sol_thread_target::update_thread_list().
|
static |
Definition at line 193 of file sol-thread.c.
|
static |
Definition at line 197 of file sol-thread.c.
Referenced by info_cb(), lwp_to_thread(), sol_update_thread_list_callback(), and thread_to_lwp().
|
static |
Definition at line 198 of file sol-thread.c.
Referenced by sol_thread_target::fetch_registers(), and sol_thread_target::store_registers().
|
static |
Definition at line 208 of file sol-thread.c.
Referenced by sol_thread_target::fetch_registers(), and sol_thread_target::store_registers().
|
static |
Definition at line 200 of file sol-thread.c.
|
static |
Definition at line 199 of file sol-thread.c.
|
static |
Definition at line 204 of file sol-thread.c.
Referenced by sol_thread_target::store_registers().
|
static |
Definition at line 209 of file sol-thread.c.
Referenced by sol_thread_target::store_registers().
|
static |
Definition at line 202 of file sol-thread.c.
|
static |
Definition at line 203 of file sol-thread.c.
|
static |
Definition at line 205 of file sol-thread.c.
|
static |
Definition at line 201 of file sol-thread.c.
|
static |
Definition at line 196 of file sol-thread.c.
|
static |
Definition at line 195 of file sol-thread.c.
Referenced by lwp_to_thread(), and sol_thread_target::thread_alive().
|
static |
Definition at line 129 of file sol-thread.c.
Referenced by check_for_thread_db(), sol_thread_target::detach(), and sol_thread_target::mourn_inferior().
|
static |
Definition at line 107 of file sol-thread.c.
Referenced by check_for_thread_db().
|
static |
Definition at line 72 of file sol-thread.c.
Referenced by sol_thread_target::info().