GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions | Variables
sol-thread.c File Reference
#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)
 

Typedefs

typedef void td_log_ftype(const int on_off)
 
typedef td_err_e td_ta_new_ftype(const struct ps_prochandle *ph_p, td_thragent_t **ta_pp)
 
typedef td_err_e td_ta_delete_ftype(td_thragent_t *ta_p)
 
typedef td_err_e td_init_ftype(void)
 
typedef td_err_e td_ta_get_ph_ftype(const td_thragent_t *ta_p, struct ps_prochandle **ph_pp)
 
typedef td_err_e td_ta_get_nthreads_ftype(const td_thragent_t *ta_p, int *nthread_p)
 
typedef td_err_e td_ta_tsd_iter_ftype(const td_thragent_t *ta_p, td_key_iter_f *cb, void *cbdata_p)
 
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)
 
typedef td_err_e td_thr_validate_ftype(const td_thrhandle_t *th_p)
 
typedef td_err_e td_thr_tsd_ftype(const td_thrhandle_t *th_p, const thread_key_t key, void **data_pp)
 
typedef td_err_e td_thr_get_info_ftype(const td_thrhandle_t *th_p, td_thrinfo_t *ti_p)
 
typedef td_err_e td_thr_getfpregs_ftype(const td_thrhandle_t *th_p, prfpregset_t *fpregset)
 
typedef td_err_e td_thr_getxregsize_ftype(const td_thrhandle_t *th_p, int *xregsize)
 
typedef td_err_e td_thr_getxregs_ftype(const td_thrhandle_t *th_p, const caddr_t xregset)
 
typedef td_err_e td_thr_sigsetmask_ftype(const td_thrhandle_t *th_p, const sigset_t ti_sigmask)
 
typedef td_err_e td_thr_setprio_ftype(const td_thrhandle_t *th_p, const int ti_pri)
 
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)
 
typedef td_err_e td_thr_setfpregs_ftype(const td_thrhandle_t *th_p, const prfpregset_t *fpregset)
 
typedef td_err_e td_thr_setxregs_ftype(const td_thrhandle_t *th_p, const caddr_t xregset)
 
typedef td_err_e td_ta_map_id2thr_ftype(const td_thragent_t *ta_p, thread_t tid, td_thrhandle_t *th_p)
 
typedef td_err_e td_ta_map_lwp2thr_ftype(const td_thragent_t *ta_p, lwpid_t lwpid, td_thrhandle_t *th_p)
 
typedef td_err_e td_thr_getgregs_ftype(const td_thrhandle_t *th_p, prgregset_t regset)
 
typedef td_err_e td_thr_setgregs_ftype(const td_thrhandle_t *th_p, const prgregset_t regset)
 

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 ()
 

Variables

static const target_info thread_db_target_info
 
static sol_thread_target sol_thread_ops
 
static struct ps_prochandle main_ph
 
static td_thragent_tmain_ta
 
static int sol_thread_active = 0
 
static td_log_ftypep_td_log
 
static td_ta_new_ftypep_td_ta_new
 
static td_ta_delete_ftypep_td_ta_delete
 
static td_init_ftypep_td_init
 
static td_ta_get_ph_ftypep_td_ta_get_ph
 
static td_ta_get_nthreads_ftypep_td_ta_get_nthreads
 
static td_ta_tsd_iter_ftypep_td_ta_tsd_iter
 
static td_ta_thr_iter_ftypep_td_ta_thr_iter
 
static td_thr_validate_ftypep_td_thr_validate
 
static td_thr_tsd_ftypep_td_thr_tsd
 
static td_thr_get_info_ftypep_td_thr_get_info
 
static td_thr_getfpregs_ftypep_td_thr_getfpregs
 
static td_thr_getxregsize_ftypep_td_thr_getxregsize
 
static td_thr_getxregs_ftypep_td_thr_getxregs
 
static td_thr_sigsetmask_ftypep_td_thr_sigsetmask
 
static td_thr_setprio_ftypep_td_thr_setprio
 
static td_thr_setsigpending_ftypep_td_thr_setsigpending
 
static td_thr_setfpregs_ftypep_td_thr_setfpregs
 
static td_thr_setxregs_ftypep_td_thr_setxregs
 
static td_ta_map_id2thr_ftypep_td_ta_map_id2thr
 
static td_ta_map_lwp2thr_ftypep_td_ta_map_lwp2thr
 
static td_thr_getgregs_ftypep_td_thr_getgregs
 
static td_thr_setgregs_ftypep_td_thr_setgregs
 

Macro Definition Documentation

◆ resolve

#define resolve ( X)
Value:
if (!(p_##X = (X ## _ftype *) dlsym (dlhandle, #X))) \
goto die;
#define X(n)

Typedef Documentation

◆ td_init_ftype

typedef td_err_e td_init_ftype(void)

Definition at line 140 of file sol-thread.c.

◆ td_log_ftype

typedef void td_log_ftype(const int on_off)

Definition at line 136 of file sol-thread.c.

◆ td_ta_delete_ftype

typedef td_err_e td_ta_delete_ftype(td_thragent_t *ta_p)

Definition at line 139 of file sol-thread.c.

◆ td_ta_get_nthreads_ftype

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.

◆ td_ta_get_ph_ftype

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.

◆ td_ta_map_id2thr_ftype

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.

◆ td_ta_map_lwp2thr_ftype

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.

◆ td_ta_new_ftype

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.

◆ td_ta_thr_iter_ftype

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.

◆ td_ta_tsd_iter_ftype

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.

◆ td_thr_get_info_ftype

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.

◆ td_thr_getfpregs_ftype

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.

◆ td_thr_getgregs_ftype

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.

◆ td_thr_getxregs_ftype

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.

◆ td_thr_getxregsize_ftype

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.

◆ td_thr_setfpregs_ftype

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.

◆ td_thr_setgregs_ftype

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.

◆ td_thr_setprio_ftype

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.

◆ td_thr_setsigpending_ftype

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.

◆ td_thr_setxregs_ftype

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.

◆ td_thr_sigsetmask_ftype

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.

◆ td_thr_tsd_ftype

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.

◆ td_thr_validate_ftype

typedef td_err_e td_thr_validate_ftype(const td_thrhandle_t *th_p)

Definition at line 152 of file sol-thread.c.

Function Documentation

◆ _initialize_sol_thread()

void _initialize_sol_thread ( )

◆ check_for_thread_db()

static void check_for_thread_db ( void )
static

◆ info_cb()

static int info_cb ( const td_thrhandle_t * th,
void * s )
static

◆ info_solthreads()

static void info_solthreads ( const char * args,
int from_tty )
static

◆ lwp_to_thread()

static ptid_t lwp_to_thread ( ptid_t lwp)
static

◆ ps_lcontinue()

ps_err_e ps_lcontinue ( struct ps_prochandle * ph,
lwpid_t lwpid )

Definition at line 752 of file sol-thread.c.

◆ ps_lgetfpregs()

ps_err_e ps_lgetfpregs ( struct ps_prochandle * ph,
lwpid_t lwpid,
prfpregset_t * fpregset )

◆ ps_lgetregs()

ps_err_e ps_lgetregs ( struct ps_prochandle * ph,
lwpid_t lwpid,
prgregset_t gregset )

◆ ps_lgetxregs()

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_lgetxregsize()

ps_err_e ps_lgetxregsize ( struct ps_prochandle * ph,
lwpid_t lwpid,
int * xregsize )

Definition at line 890 of file sol-thread.c.

◆ ps_lsetfpregs()

ps_err_e ps_lsetfpregs ( struct ps_prochandle * ph,
lwpid_t lwpid,
const prfpregset_t * fpregset )

◆ ps_lsetregs()

ps_err_e ps_lsetregs ( struct ps_prochandle * ph,
lwpid_t lwpid,
const prgregset_t gregset )

◆ ps_lsetxregs()

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_lstop()

ps_err_e ps_lstop ( struct ps_prochandle * ph,
lwpid_t lwpid )

Definition at line 744 of file sol-thread.c.

◆ ps_pcontinue()

ps_err_e ps_pcontinue ( struct ps_prochandle * ph)

Definition at line 736 of file sol-thread.c.

◆ ps_pdmodel()

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_pdread()

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_pdwrite()

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_pglobal_lookup()

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 )

◆ ps_plog()

void ps_plog ( const char * fmt,
... )

Definition at line 878 of file sol-thread.c.

References gdb_stderr, and gdb_vprintf().

◆ ps_pstop()

ps_err_e ps_pstop ( struct ps_prochandle * ph)

Definition at line 728 of file sol-thread.c.

◆ ps_ptread()

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_ptwrite()

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.

◆ rw_common()

static ps_err_e rw_common ( int dowrite,
const struct ps_prochandle * ph,
psaddr_t addr,
gdb_byte * buf,
int size )
static

◆ sol_thread_new_objfile()

static void sol_thread_new_objfile ( struct objfile * objfile)
static

Definition at line 669 of file sol-thread.c.

References check_for_thread_db().

Referenced by _initialize_sol_thread().

◆ sol_update_thread_list_callback()

static int sol_update_thread_list_callback ( const td_thrhandle_t * th,
void * ignored )
static

◆ td_err_string()

static const char * td_err_string ( td_err_e errcode)
static

◆ td_state_string()

static const char * td_state_string ( td_thr_state_e statecode)
static

◆ thread_db_find_thread_from_tid()

static int thread_db_find_thread_from_tid ( struct thread_info * thread,
void * data )
static

Definition at line 1120 of file sol-thread.c.

References thread_info::ptid.

Referenced by sol_thread_target::get_ada_task_ptid().

◆ thread_to_lwp()

static ptid_t thread_to_lwp ( ptid_t thread_id,
int default_lwp )
static

Variable Documentation

◆ main_ph

struct ps_prochandle main_ph
static

◆ main_ta

td_thragent_t* main_ta
static

◆ p_td_init

td_init_ftype* p_td_init
static

Definition at line 190 of file sol-thread.c.

Referenced by check_for_thread_db().

◆ p_td_log

td_log_ftype* p_td_log
static

Definition at line 187 of file sol-thread.c.

◆ p_td_ta_delete

td_ta_delete_ftype* p_td_ta_delete
static

Definition at line 189 of file sol-thread.c.

◆ p_td_ta_get_nthreads

td_ta_get_nthreads_ftype* p_td_ta_get_nthreads
static

Definition at line 192 of file sol-thread.c.

◆ p_td_ta_get_ph

td_ta_get_ph_ftype* p_td_ta_get_ph
static

Definition at line 191 of file sol-thread.c.

◆ p_td_ta_map_id2thr

td_ta_map_id2thr_ftype* p_td_ta_map_id2thr
static

◆ p_td_ta_map_lwp2thr

td_ta_map_lwp2thr_ftype* p_td_ta_map_lwp2thr
static

Definition at line 207 of file sol-thread.c.

Referenced by lwp_to_thread().

◆ p_td_ta_new

td_ta_new_ftype* p_td_ta_new
static

Definition at line 188 of file sol-thread.c.

Referenced by check_for_thread_db().

◆ p_td_ta_thr_iter

td_ta_thr_iter_ftype* p_td_ta_thr_iter
static

Definition at line 194 of file sol-thread.c.

Referenced by info_solthreads(), and sol_thread_target::update_thread_list().

◆ p_td_ta_tsd_iter

td_ta_tsd_iter_ftype* p_td_ta_tsd_iter
static

Definition at line 193 of file sol-thread.c.

◆ p_td_thr_get_info

td_thr_get_info_ftype* p_td_thr_get_info
static

◆ p_td_thr_getfpregs

td_thr_getfpregs_ftype* p_td_thr_getfpregs
static

◆ p_td_thr_getgregs

td_thr_getgregs_ftype* p_td_thr_getgregs
static

◆ p_td_thr_getxregs

td_thr_getxregs_ftype* p_td_thr_getxregs
static

Definition at line 200 of file sol-thread.c.

◆ p_td_thr_getxregsize

td_thr_getxregsize_ftype* p_td_thr_getxregsize
static

Definition at line 199 of file sol-thread.c.

◆ p_td_thr_setfpregs

td_thr_setfpregs_ftype* p_td_thr_setfpregs
static

Definition at line 204 of file sol-thread.c.

Referenced by sol_thread_target::store_registers().

◆ p_td_thr_setgregs

td_thr_setgregs_ftype* p_td_thr_setgregs
static

Definition at line 209 of file sol-thread.c.

Referenced by sol_thread_target::store_registers().

◆ p_td_thr_setprio

td_thr_setprio_ftype* p_td_thr_setprio
static

Definition at line 202 of file sol-thread.c.

◆ p_td_thr_setsigpending

td_thr_setsigpending_ftype* p_td_thr_setsigpending
static

Definition at line 203 of file sol-thread.c.

◆ p_td_thr_setxregs

td_thr_setxregs_ftype* p_td_thr_setxregs
static

Definition at line 205 of file sol-thread.c.

◆ p_td_thr_sigsetmask

td_thr_sigsetmask_ftype* p_td_thr_sigsetmask
static

Definition at line 201 of file sol-thread.c.

◆ p_td_thr_tsd

td_thr_tsd_ftype* p_td_thr_tsd
static

Definition at line 196 of file sol-thread.c.

◆ p_td_thr_validate

td_thr_validate_ftype* p_td_thr_validate
static

Definition at line 195 of file sol-thread.c.

Referenced by lwp_to_thread(), and sol_thread_target::thread_alive().

◆ sol_thread_active

int sol_thread_active = 0
static

◆ sol_thread_ops

sol_thread_target sol_thread_ops
static

Definition at line 107 of file sol-thread.c.

Referenced by check_for_thread_db().

◆ thread_db_target_info

const target_info thread_db_target_info
static
Initial value:
= {
"solaris-threads",
N_("Solaris threads and pthread."),
}

Definition at line 72 of file sol-thread.c.

Referenced by sol_thread_target::info().