GDB (xrefs)
Classes | Typedefs | Functions | Variables
/home/stan/gdb/src/gdb/dec-thread.c File Reference
#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 Documentation

Definition at line 281 of file dec-thread.c.


Function Documentation

void _initialize_dec_thread ( void  )
static void debug ( char *  format,
  ... 
) [static]
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]
static void dec_thread_fetch_registers ( struct target_ops ops,
struct regcache regcache,
int  regno 
) [static]
static void dec_thread_find_new_threads ( struct target_ops ops) [static]
static ptid_t dec_thread_get_ada_task_ptid ( long  lwp,
long  thread 
) [static]
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]
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]
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]
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]
static void disable_dec_thread ( void  ) [static]
static void enable_dec_thread ( void  ) [static]
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]
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().

static int hold_clbk ( void *  caller_context,
pthreadDebugKId_t  kernel_tid 
) [static]

Definition at line 76 of file dec-thread.c.

static void init_dec_thread_ops ( void  ) [static]
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]
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]
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 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().


Variable Documentation

pthreadDebugCallbacks_t debug_callbacks [static]
Initial value:
{
  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
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]
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines