GDB (xrefs)
Classes | Macros | Typedefs | Functions | Variables
/tmp/gdb-7.10/gdb/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 "observer.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

struct  ps_prochandle
 
struct  string_map
 

Macros

#define resolve(X)
 

Typedefs

typedef struct ps_prochandlegdb_ps_prochandle_t
 
typedef void * gdb_ps_read_buf_t
 
typedef const void * gdb_ps_write_buf_t
 
typedef size_t gdb_ps_size_t
 
typedef psaddr_t gdb_ps_addr_t
 

Functions

static void init_sol_thread_ops (void)
 
static char * td_err_string (td_err_e errcode)
 
static 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 sol_thread_detach (struct target_ops *ops, const char *args, int from_tty)
 
static void sol_thread_resume (struct target_ops *ops, ptid_t ptid, int step, enum gdb_signal signo)
 
static ptid_t sol_thread_wait (struct target_ops *ops, ptid_t ptid, struct target_waitstatus *ourstatus, int options)
 
static void sol_thread_fetch_registers (struct target_ops *ops, struct regcache *regcache, int regnum)
 
static void sol_thread_store_registers (struct target_ops *ops, struct regcache *regcache, int regnum)
 
static enum target_xfer_status sol_thread_xfer_partial (struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len)
 
static void check_for_thread_db (void)
 
static void sol_thread_new_objfile (struct objfile *objfile)
 
static void sol_thread_mourn_inferior (struct target_ops *ops)
 
static int sol_thread_alive (struct target_ops *ops, ptid_t ptid)
 
ps_err_e ps_pstop (gdb_ps_prochandle_t ph)
 
ps_err_e ps_pcontinue (gdb_ps_prochandle_t ph)
 
ps_err_e ps_lstop (gdb_ps_prochandle_t ph, lwpid_t lwpid)
 
ps_err_e ps_lcontinue (gdb_ps_prochandle_t ph, lwpid_t lwpid)
 
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)
 
static ps_err_e rw_common (int dowrite, const struct ps_prochandle *ph, gdb_ps_addr_t addr, gdb_byte *buf, int size)
 
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)
 
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)
 
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)
 
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)
 
ps_err_e ps_lgetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, prgregset_t gregset)
 
ps_err_e ps_lsetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, const prgregset_t gregset)
 
void ps_plog (const char *fmt,...)
 
ps_err_e ps_lgetxregsize (gdb_ps_prochandle_t ph, lwpid_t lwpid, int *xregsize)
 
ps_err_e ps_lgetxregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, caddr_t xregset)
 
ps_err_e ps_lsetxregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, caddr_t xregset)
 
ps_err_e ps_lgetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, prfpregset_t *fpregset)
 
ps_err_e ps_lsetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, const prfpregset_t *fpregset)
 
static char * solaris_pid_to_str (struct target_ops *ops, ptid_t ptid)
 
static int sol_update_thread_list_callback (const td_thrhandle_t *th, void *ignored)
 
static void sol_update_thread_list (struct target_ops *ops)
 
static int info_cb (const td_thrhandle_t *th, void *s)
 
static void info_solthreads (char *args, int from_tty)
 
static int thread_db_find_thread_from_tid (struct thread_info *thread, void *data)
 
static ptid_t sol_get_ada_task_ptid (struct target_ops *self, long lwp, long thread)
 
void _initialize_sol_thread (void)
 

Variables

struct target_ops sol_thread_ops
 
static struct ps_prochandle main_ph
 
static td_thragent_tmain_ta
 
static int sol_thread_active = 0
 
static void(* p_td_log )(const int on_off)
 
static td_err_e(* p_td_ta_new )(const struct ps_prochandle *ph_p, td_thragent_t **ta_pp)
 
static td_err_e(* p_td_ta_delete )(td_thragent_t *ta_p)
 
static td_err_e(* p_td_init )(void)
 
static td_err_e(* p_td_ta_get_ph )(const td_thragent_t *ta_p, struct ps_prochandle **ph_pp)
 
static td_err_e(* p_td_ta_get_nthreads )(const td_thragent_t *ta_p, int *nthread_p)
 
static td_err_e(* p_td_ta_tsd_iter )(const td_thragent_t *ta_p, td_key_iter_f *cb, void *cbdata_p)
 
static 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 td_err_e(* p_td_thr_validate )(const td_thrhandle_t *th_p)
 
static td_err_e(* p_td_thr_tsd )(const td_thrhandle_t *th_p, const thread_key_t key, void **data_pp)
 
static td_err_e(* p_td_thr_get_info )(const td_thrhandle_t *th_p, td_thrinfo_t *ti_p)
 
static td_err_e(* p_td_thr_getfpregs )(const td_thrhandle_t *th_p, prfpregset_t *fpregset)
 
static td_err_e(* p_td_thr_getxregsize )(const td_thrhandle_t *th_p, int *xregsize)
 
static td_err_e(* p_td_thr_getxregs )(const td_thrhandle_t *th_p, const caddr_t xregset)
 
static td_err_e(* p_td_thr_sigsetmask )(const td_thrhandle_t *th_p, const sigset_t ti_sigmask)
 
static td_err_e(* p_td_thr_setprio )(const td_thrhandle_t *th_p, const int ti_pri)
 
static 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 td_err_e(* p_td_thr_setfpregs )(const td_thrhandle_t *th_p, const prfpregset_t *fpregset)
 
static td_err_e(* p_td_thr_setxregs )(const td_thrhandle_t *th_p, const caddr_t xregset)
 
static td_err_e(* p_td_ta_map_id2thr )(const td_thragent_t *ta_p, thread_t tid, td_thrhandle_t *th_p)
 
static td_err_e(* p_td_ta_map_lwp2thr )(const td_thragent_t *ta_p, lwpid_t lwpid, td_thrhandle_t *th_p)
 
static td_err_e(* p_td_thr_getgregs )(const td_thrhandle_t *th_p, prgregset_t regset)
 
static td_err_e(* p_td_thr_setgregs )(const td_thrhandle_t *th_p, const prgregset_t regset)
 

Macro Definition Documentation

#define resolve (   X)
Value:
if (!(p_##X = dlsym (dlhandle, #X))) \
goto die;
Definition: ia64-tdep.c:85

Referenced by _initialize_sol_thread().

Typedef Documentation

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

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

typedef void* gdb_ps_read_buf_t

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

typedef size_t gdb_ps_size_t

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

typedef const void* gdb_ps_write_buf_t

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

Function Documentation

void _initialize_sol_thread ( void  )
static void check_for_thread_db ( void  )
static
static int info_cb ( const td_thrhandle_t th,
void *  s 
)
static
static void info_solthreads ( char *  args,
int  from_tty 
)
static
static void init_sol_thread_ops ( void  )
static
static ptid_t lwp_to_thread ( ptid_t  lwp)
static
ps_err_e ps_lcontinue ( gdb_ps_prochandle_t  ph,
lwpid_t  lwpid 
)

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

References PS_OK.

ps_err_e ps_lgetfpregs ( gdb_ps_prochandle_t  ph,
lwpid_t  lwpid,
prfpregset_t fpregset 
)
ps_err_e ps_lgetregs ( gdb_ps_prochandle_t  ph,
lwpid_t  lwpid,
prgregset_t  gregset 
)
ps_err_e ps_lgetxregs ( gdb_ps_prochandle_t  ph,
lwpid_t  lwpid,
caddr_t  xregset 
)

Definition at line 917 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 909 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 
)
ps_err_e ps_lsetregs ( gdb_ps_prochandle_t  ph,
lwpid_t  lwpid,
const prgregset_t  gregset 
)
ps_err_e ps_lsetxregs ( gdb_ps_prochandle_t  ph,
lwpid_t  lwpid,
caddr_t  xregset 
)

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

References PS_OK.

ps_err_e ps_lstop ( gdb_ps_prochandle_t  ph,
lwpid_t  lwpid 
)

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

References PS_OK.

ps_err_e ps_pcontinue ( gdb_ps_prochandle_t  ph)

Definition at line 740 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 818 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 827 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 764 of file sol-thread.c.

References BMSYMBOL_VALUE_ADDRESS, lookup_minimal_symbol(), PS_NOSYM, and PS_OK.

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

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

References gdb_stderr, and vfprintf_filtered().

ps_err_e ps_pstop ( gdb_ps_prochandle_t  ph)

Definition at line 732 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 836 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 845 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
static ptid_t sol_get_ada_task_ptid ( struct target_ops self,
long  lwp,
long  thread 
)
static
static int sol_thread_alive ( struct target_ops ops,
ptid_t  ptid 
)
static
static void sol_thread_detach ( struct target_ops ops,
const char *  args,
int  from_tty 
)
static
static void sol_thread_fetch_registers ( struct target_ops ops,
struct regcache regcache,
int  regnum 
)
static
static void sol_thread_mourn_inferior ( struct target_ops ops)
static
static void sol_thread_new_objfile ( struct objfile objfile)
static

Definition at line 644 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
static void sol_thread_store_registers ( struct target_ops ops,
struct regcache regcache,
int  regnum 
)
static
static ptid_t sol_thread_wait ( struct target_ops ops,
ptid_t  ptid,
struct target_waitstatus ourstatus,
int  options 
)
static
static enum target_xfer_status sol_thread_xfer_partial ( struct target_ops ops,
enum target_object  object,
const char *  annex,
gdb_byte readbuf,
const gdb_byte writebuf,
ULONGEST  offset,
ULONGEST  len,
ULONGEST xfered_len 
)
static
static void sol_update_thread_list ( struct target_ops ops)
static
static int sol_update_thread_list_callback ( const td_thrhandle_t th,
void *  ignored 
)
static
static char* solaris_pid_to_str ( struct target_ops ops,
ptid_t  ptid 
)
static
static char* td_err_string ( td_err_e  errcode)
static
static char* td_state_string ( td_thr_state_e  statecode)
static
static int thread_db_find_thread_from_tid ( struct thread_info thread,
void *  data 
)
static

Definition at line 1186 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

Variable Documentation

struct ps_prochandle main_ph
static
td_thragent_t* main_ta
static
td_err_e(* p_td_init) (void)
static

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

Referenced by check_for_thread_db().

void(* p_td_log) (const int on_off)
static

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

td_err_e(* p_td_ta_delete) (td_thragent_t *ta_p)
static

Definition at line 106 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 110 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 108 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
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 144 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 104 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 114 of file sol-thread.c.

Referenced by info_solthreads(), and sol_update_thread_list().

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 112 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
td_err_e(* p_td_thr_getfpregs) (const td_thrhandle_t *th_p, prfpregset_t *fpregset)
static

Definition at line 124 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 147 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 128 of file sol-thread.c.

td_err_e(* p_td_thr_getxregsize) (const td_thrhandle_t *th_p, int *xregsize)
static

Definition at line 126 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 137 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 149 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 132 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 134 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 139 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 130 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 120 of file sol-thread.c.

td_err_e(* p_td_thr_validate) (const td_thrhandle_t *th_p)
static

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

Referenced by lwp_to_thread(), and sol_thread_alive().

int sol_thread_active = 0
static

Definition at line 94 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 72 of file sol-thread.c.

Referenced by _initialize_sol_thread(), check_for_thread_db(), and init_sol_thread_ops().