GDB (xrefs)
Classes | Defines | Typedefs | Functions | Variables
/home/stan/gdb/src/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 "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.

Classes

struct  ps_prochandle
struct  string_map

Defines

#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, 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 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 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_find_new_threads_callback (const td_thrhandle_t *th, void *ignored)
static void sol_find_new_threads (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 (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)

Define Documentation

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

Referenced by _initialize_sol_thread().


Typedef Documentation

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

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.


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]

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 
)
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_lsetxregs ( gdb_ps_prochandle_t  ph,
lwpid_t  lwpid,
caddr_t  xregset 
)

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

References PS_OK.

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

References PS_OK.

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

References PS_OK.

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

References rw_common().

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.

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

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.

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

References rw_common().

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]
static void sol_find_new_threads ( struct target_ops ops) [static]
static int sol_find_new_threads_callback ( const td_thrhandle_t th,
void *  ignored 
) [static]
static ptid_t sol_get_ada_task_ptid ( 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,
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 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]
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 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]
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 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]

Variable Documentation

struct ps_prochandle main_ph [static]
td_err_e(* p_td_init)(void) [static]

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

Referenced by check_for_thread_db().

void(* p_td_log)(const int on_off) [static]

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

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.

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.

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

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

Referenced by sol_thread_fetch_registers(), and sol_thread_store_registers().

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.

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

Referenced by sol_thread_store_registers().

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.

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

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

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

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines