GDB (xrefs)
|
#include "defs.h"
#include "command.h"
#include "gdbcmd.h"
#include "target.h"
#include "observer.h"
#include <sys/procfs.h>
#include "gregset.h"
#include "regcache.h"
#include "inferior.h"
#include "gdbthread.h"
#include <pthread_debug.h>
Go to the source code of this file.
Classes | |
struct | dec_thread_info |
Typedefs | |
typedef struct dec_thread_info | dec_thread_info_s |
Functions | |
static void | debug (char *format,...) |
static int | suspend_clbk (void *caller_context) |
static int | resume_clbk (void *caller_context) |
static int | hold_clbk (void *caller_context, pthreadDebugKId_t kernel_tid) |
static int | unhold_clbk (void *caller_context, pthreadDebugKId_t kernel_tid) |
static int | read_clbk (void *caller_context, void *address, void *buffer, unsigned long size) |
static int | write_clbk (void *caller_context, void *address, void *buffer, unsigned long size) |
static int | get_reg_clbk (void *caller_context, pthreadDebugGetRegRtn_t regs, pthreadDebugKId_t kernel_tid) |
static int | set_reg_clbk (void *caller_context, const pthreadDebugRegs_t *regs, pthreadDebugKId_t kernel_tid) |
static int | output_clbk (void *caller_context, char *line) |
static int | error_clbk (void *caller_context, char *line) |
static int | get_fpreg_clbk (void *caller_context, pthreadDebugFregs_p fregs, pthreadDebugKId_t kernel_tid) |
static int | set_fpreg_clbk (void *caller_context, const pthreadDebugFregs_t *fregs, pthreadDebugKId_t kernel_tid) |
static void * | malloc_clbk (void *caller_context, size_t size) |
static void | free_clbk (void *caller_context, void *address) |
static int | kthdinfo_clbk (pthreadDebugClient_t caller_context, pthreadDebugKId_t kernel_tid, pthreadDebugKThreadInfo_p thread_info) |
static int | speckthd_clbk (pthreadDebugClient_t caller_context, pthreadDebugSpecialType_t type, pthreadDebugKId_t *kernel_tid) |
static void | enable_dec_thread (void) |
static void | disable_dec_thread (void) |
DEF_VEC_O (dec_thread_info_s) | |
VEC (dec_thread_info_s) | |
static ptid_t | ptid_build_from_info (struct dec_thread_info info) |
static int | dec_thread_ptid_is_alive (ptid_t ptid) |
static void | update_dec_thread_list (void) |
static int | dec_thread_count_gdb_threads (struct thread_info *ignored, void *context) |
static int | dec_thread_add_gdb_thread (struct thread_info *info, void *context) |
static void | dec_thread_find_new_threads (struct target_ops *ops) |
static void | resync_thread_list (struct target_ops *ops) |
static void | dec_thread_detach (struct target_ops *ops, char *args, int from_tty) |
static ptid_t | get_active_ptid (void) |
static ptid_t | dec_thread_wait (struct target_ops *ops, ptid_t ptid, struct target_waitstatus *status, int options) |
static int | dec_thread_get_regsets (pthreadDebugId_t tid, gdb_gregset_t *gregset, gdb_fpregset_t *fpregset) |
static void | dec_thread_fetch_registers (struct target_ops *ops, struct regcache *regcache, int regno) |
static int | dec_thread_set_regsets (pthreadDebugId_t tid, gdb_gregset_t gregset, gdb_fpregset_t fpregset) |
static void | dec_thread_store_registers (struct target_ops *ops, struct regcache *regcache, int regno) |
static void | dec_thread_mourn_inferior (struct target_ops *ops) |
static int | dec_thread_thread_alive (struct target_ops *ops, ptid_t ptid) |
static char * | dec_thread_pid_to_str (struct target_ops *ops, ptid_t ptid) |
static void | dec_thread_new_objfile_observer (struct objfile *objfile) |
static ptid_t | dec_thread_get_ada_task_ptid (long lwp, long thread) |
static void | init_dec_thread_ops (void) |
void | _initialize_dec_thread (void) |
Variables | |
static int | debug_dec_thread = 0 |
static int | dec_thread_active = 0 |
pthreadDebugContext_t | debug_context |
static struct target_ops | dec_thread_ops |
static pthreadDebugCallbacks_t | debug_callbacks |
typedef struct dec_thread_info dec_thread_info_s |
Definition at line 281 of file dec-thread.c.
void _initialize_dec_thread | ( | void | ) |
Definition at line 727 of file dec-thread.c.
References _, add_setshow_boolean_cmd(), class_maintenance, complete_target_initialization(), debug_dec_thread, dec_thread_new_objfile_observer(), dec_thread_ops, init_dec_thread_ops(), observer_attach_new_objfile(), setdebuglist, and showdebuglist.
static void debug | ( | char * | format, |
... | |||
) | [static] |
Definition at line 47 of file dec-thread.c.
References debug_dec_thread, printf_unfiltered(), and vprintf_unfiltered().
Referenced by dec_thread_detach(), dec_thread_fetch_registers(), dec_thread_get_ada_task_ptid(), dec_thread_get_regsets(), dec_thread_mourn_inferior(), dec_thread_set_regsets(), dec_thread_store_registers(), dec_thread_thread_alive(), dec_thread_wait(), enable_dec_thread(), get_fpreg_clbk(), get_reg_clbk(), set_fpreg_clbk(), and set_reg_clbk().
static int dec_thread_add_gdb_thread | ( | struct thread_info * | info, |
void * | context | ||
) | [static] |
Definition at line 388 of file dec-thread.c.
Referenced by resync_thread_list().
static int dec_thread_count_gdb_threads | ( | struct thread_info * | ignored, |
void * | context | ||
) | [static] |
Definition at line 375 of file dec-thread.c.
Referenced by resync_thread_list().
static void dec_thread_detach | ( | struct target_ops * | ops, |
char * | args, | ||
int | from_tty | ||
) | [static] |
Definition at line 447 of file dec-thread.c.
References target_ops::beneath, debug(), disable_dec_thread(), find_target_beneath(), and target_ops::to_detach.
Referenced by init_dec_thread_ops().
static void dec_thread_fetch_registers | ( | struct target_ops * | ops, |
struct regcache * | regcache, | ||
int | regno | ||
) | [static] |
Definition at line 535 of file dec-thread.c.
References target_ops::beneath, debug(), dec_thread_get_regsets(), find_target_beneath(), get_active_ptid(), inferior_ptid, ptid_equal(), ptid_get_tid(), supply_fpregset(), supply_gregset(), and target_ops::to_fetch_registers.
Referenced by init_dec_thread_ops().
static void dec_thread_find_new_threads | ( | struct target_ops * | ops | ) | [static] |
Definition at line 400 of file dec-thread.c.
References add_thread(), in_thread_list(), dec_thread_info::info, ptid_build_from_info(), update_dec_thread_list(), and VEC_iterate.
Referenced by init_dec_thread_ops(), and resync_thread_list().
static ptid_t dec_thread_get_ada_task_ptid | ( | long | lwp, |
long | thread | ||
) | [static] |
Definition at line 690 of file dec-thread.c.
References _, debug(), inferior_ptid, dec_thread_info::info, ptid_build_from_info(), dec_thread_info::thread, VEC_iterate, and warning().
Referenced by init_dec_thread_ops().
static int dec_thread_get_regsets | ( | pthreadDebugId_t | tid, |
gdb_gregset_t * | gregset, | ||
gdb_fpregset_t * | fpregset | ||
) | [static] |
Definition at line 502 of file dec-thread.c.
References debug(), debug_context, and memcpy().
Referenced by dec_thread_fetch_registers().
static void dec_thread_mourn_inferior | ( | struct target_ops * | ops | ) | [static] |
Definition at line 632 of file dec-thread.c.
References target_ops::beneath, debug(), disable_dec_thread(), find_target_beneath(), and target_ops::to_mourn_inferior.
Referenced by init_dec_thread_ops().
static void dec_thread_new_objfile_observer | ( | struct objfile * | objfile | ) | [static] |
Definition at line 679 of file dec-thread.c.
References disable_dec_thread(), and enable_dec_thread().
Referenced by _initialize_dec_thread().
static char* dec_thread_pid_to_str | ( | struct target_ops * | ops, |
ptid_t | ptid | ||
) | [static] |
Definition at line 656 of file dec-thread.c.
References _, target_ops::beneath, find_target_beneath(), ptid_get_tid(), target_ops::to_pid_to_str, xfree(), and xstrprintf().
Referenced by init_dec_thread_ops().
static int dec_thread_ptid_is_alive | ( | ptid_t | ptid | ) | [static] |
Definition at line 318 of file dec-thread.c.
References dec_thread_info::info, ptid_get_tid(), dec_thread_info::thread, and VEC_iterate.
Referenced by resync_thread_list().
static int dec_thread_set_regsets | ( | pthreadDebugId_t | tid, |
gdb_gregset_t | gregset, | ||
gdb_fpregset_t | fpregset | ||
) | [static] |
Definition at line 567 of file dec-thread.c.
References debug(), debug_context, and memcpy().
Referenced by dec_thread_store_registers().
static void dec_thread_store_registers | ( | struct target_ops * | ops, |
struct regcache * | regcache, | ||
int | regno | ||
) | [static] |
Definition at line 599 of file dec-thread.c.
References _, target_ops::beneath, debug(), dec_thread_set_regsets(), fill_fpregset(), fill_gregset(), find_target_beneath(), get_active_ptid(), inferior_ptid, ptid_equal(), ptid_get_tid(), target_ops::to_store_registers, and warning().
Referenced by init_dec_thread_ops().
static int dec_thread_thread_alive | ( | struct target_ops * | ops, |
ptid_t | ptid | ||
) | [static] |
Definition at line 644 of file dec-thread.c.
References debug(), in_thread_list(), and ptid_get_tid().
Referenced by init_dec_thread_ops().
static ptid_t dec_thread_wait | ( | struct target_ops * | ops, |
ptid_t | ptid, | ||
struct target_waitstatus * | status, | ||
int | options | ||
) | [static] |
Definition at line 478 of file dec-thread.c.
References target_ops::beneath, debug(), find_target_beneath(), get_active_ptid(), null_ptid, ptid_equal(), resync_thread_list(), and target_ops::to_wait.
Referenced by init_dec_thread_ops().
static void disable_dec_thread | ( | void | ) | [static] |
Definition at line 263 of file dec-thread.c.
References debug_context, dec_thread_active, dec_thread_ops, and unpush_target().
Referenced by dec_thread_detach(), dec_thread_mourn_inferior(), and dec_thread_new_objfile_observer().
static void enable_dec_thread | ( | void | ) | [static] |
Definition at line 226 of file dec-thread.c.
References debug(), debug_callbacks, debug_context, dec_thread_active, dec_thread_ops, lookup_minimal_symbol(), push_target(), exsummary::status, and SYMBOL_VALUE_ADDRESS.
Referenced by dec_thread_new_objfile_observer().
static int error_clbk | ( | void * | caller_context, |
char * | line | ||
) | [static] |
Definition at line 143 of file dec-thread.c.
References fprintf_filtered(), and gdb_stderr.
static void free_clbk | ( | void * | caller_context, |
void * | address | ||
) | [static] |
Definition at line 180 of file dec-thread.c.
References xfree().
static ptid_t get_active_ptid | ( | void | ) | [static] |
Definition at line 460 of file dec-thread.c.
References dec_thread_info::info, null_ptid, ptid_build_from_info(), and VEC_iterate.
Referenced by dec_thread_fetch_registers(), dec_thread_store_registers(), and dec_thread_wait().
static int get_fpreg_clbk | ( | void * | caller_context, |
pthreadDebugFregs_p | fregs, | ||
pthreadDebugKId_t | kernel_tid | ||
) | [static] |
Definition at line 152 of file dec-thread.c.
References debug().
static int get_reg_clbk | ( | void * | caller_context, |
pthreadDebugGetRegRtn_t | regs, | ||
pthreadDebugKId_t | kernel_tid | ||
) | [static] |
Definition at line 114 of file dec-thread.c.
References debug().
Definition at line 76 of file dec-thread.c.
static void init_dec_thread_ops | ( | void | ) | [static] |
Definition at line 708 of file dec-thread.c.
References _, dec_thread_detach(), dec_thread_fetch_registers(), dec_thread_find_new_threads(), dec_thread_get_ada_task_ptid(), dec_thread_mourn_inferior(), dec_thread_ops, dec_thread_pid_to_str(), dec_thread_store_registers(), dec_thread_thread_alive(), dec_thread_wait(), OPS_MAGIC, 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_shortname, target_ops::to_store_registers, target_ops::to_stratum, target_ops::to_thread_alive, and target_ops::to_wait.
Referenced by _initialize_dec_thread().
static int kthdinfo_clbk | ( | pthreadDebugClient_t | caller_context, |
pthreadDebugKId_t | kernel_tid, | ||
pthreadDebugKThreadInfo_p | thread_info | ||
) | [static] |
Definition at line 186 of file dec-thread.c.
static void* malloc_clbk | ( | void * | caller_context, |
size_t | size | ||
) | [static] |
Definition at line 174 of file dec-thread.c.
References xmalloc().
static int output_clbk | ( | void * | caller_context, |
char * | line | ||
) | [static] |
Definition at line 136 of file dec-thread.c.
References printf_filtered().
static ptid_t ptid_build_from_info | ( | struct dec_thread_info | info | ) | [static] |
Definition at line 307 of file dec-thread.c.
References inferior_ptid, ptid_build(), ptid_get_pid(), and dec_thread_info::thread.
Referenced by dec_thread_find_new_threads(), dec_thread_get_ada_task_ptid(), and get_active_ptid().
static int read_clbk | ( | void * | caller_context, |
void * | address, | ||
void * | buffer, | ||
unsigned long | size | ||
) | [static] |
Definition at line 88 of file dec-thread.c.
References exsummary::status, and target_read_memory().
static int resume_clbk | ( | void * | caller_context | ) | [static] |
Definition at line 70 of file dec-thread.c.
static void resync_thread_list | ( | struct target_ops * | ops | ) | [static] |
Definition at line 419 of file dec-thread.c.
References dec_thread_add_gdb_thread(), dec_thread_count_gdb_threads(), dec_thread_find_new_threads(), dec_thread_ptid_is_alive(), delete_thread(), and iterate_over_threads().
Referenced by dec_thread_wait().
static int set_fpreg_clbk | ( | void * | caller_context, |
const pthreadDebugFregs_t * | fregs, | ||
pthreadDebugKId_t | kernel_tid | ||
) | [static] |
Definition at line 164 of file dec-thread.c.
References debug().
static int set_reg_clbk | ( | void * | caller_context, |
const pthreadDebugRegs_t * | regs, | ||
pthreadDebugKId_t | kernel_tid | ||
) | [static] |
Definition at line 126 of file dec-thread.c.
References debug().
static int speckthd_clbk | ( | pthreadDebugClient_t | caller_context, |
pthreadDebugSpecialType_t | type, | ||
pthreadDebugKId_t * | kernel_tid | ||
) | [static] |
Definition at line 194 of file dec-thread.c.
static int suspend_clbk | ( | void * | caller_context | ) | [static] |
Definition at line 64 of file dec-thread.c.
static int unhold_clbk | ( | void * | caller_context, |
pthreadDebugKId_t | kernel_tid | ||
) | [static] |
Definition at line 82 of file dec-thread.c.
static void update_dec_thread_list | ( | void | ) | [static] |
Definition at line 342 of file dec-thread.c.
References _, debug_context, dec_thread_info::info, dec_thread_info::thread, VEC_safe_push, warning(), and xmalloc().
Referenced by dec_thread_find_new_threads().
VEC | ( | dec_thread_info_s | ) |
Definition at line 286 of file dec-thread.c.
References VEC, VEC_free, VEC_iterate, and xfree().
static int write_clbk | ( | void * | caller_context, |
void * | address, | ||
void * | buffer, | ||
unsigned long | size | ||
) | [static] |
Definition at line 100 of file dec-thread.c.
References exsummary::status, and target_write_memory().
pthreadDebugCallbacks_t debug_callbacks [static] |
{ PTHREAD_DEBUG_VERSION, (pthreadDebugGetMemRtn_t) read_clbk, (pthreadDebugSetMemRtn_t) write_clbk, suspend_clbk, resume_clbk, kthdinfo_clbk, hold_clbk, unhold_clbk, (pthreadDebugGetFregRtn_t) get_fpreg_clbk, (pthreadDebugSetFregRtn_t) set_fpreg_clbk, (pthreadDebugGetRegRtn_t) get_reg_clbk, (pthreadDebugSetRegRtn_t) set_reg_clbk, (pthreadDebugOutputRtn_t) output_clbk, (pthreadDebugOutputRtn_t) error_clbk, malloc_clbk, free_clbk, speckthd_clbk }
Definition at line 201 of file dec-thread.c.
Referenced by enable_dec_thread().
pthreadDebugContext_t debug_context |
Definition at line 38 of file dec-thread.c.
Referenced by dec_thread_get_regsets(), dec_thread_set_regsets(), disable_dec_thread(), enable_dec_thread(), and update_dec_thread_list().
int debug_dec_thread = 0 [static] |
Definition at line 32 of file dec-thread.c.
Referenced by _initialize_dec_thread(), and debug().
int dec_thread_active = 0 [static] |
Definition at line 35 of file dec-thread.c.
Referenced by disable_dec_thread(), and enable_dec_thread().
struct target_ops dec_thread_ops [static] |
Definition at line 41 of file dec-thread.c.
Referenced by _initialize_dec_thread(), disable_dec_thread(), enable_dec_thread(), and init_dec_thread_ops().