GDB (xrefs)
Classes | Defines | Functions | Variables
/home/stan/gdb/src/gdb/aix-thread.c File Reference
#include "defs.h"
#include "gdb_assert.h"
#include "gdbthread.h"
#include "target.h"
#include "inferior.h"
#include "regcache.h"
#include "gdbcmd.h"
#include "ppc-tdep.h"
#include "gdb_string.h"
#include "observer.h"
#include <procinfo.h>
#include <sys/types.h>
#include <sys/ptrace.h>
#include <sys/reg.h>
#include <sched.h>
#include <sys/pthdebug.h>

Go to the source code of this file.

Classes

struct  private_thread_info
struct  pd_thread

Defines

#define pthdb_tid_t   tid_t
#define PD_TID(ptid)   (pd_active && ptid_get_tid (ptid) != 0)
#define PD_USER   1
#define PDC_SUCCESS   PTHDB_SUCCESS
#define PDC_FAILURE   PTHDB_CALLBACK
#define addr_ptr   int *

Functions

int getthrds (pid_t, struct thrdsinfo64 *, int, tid_t *, int)
static int pdc_symbol_addrs (pthdb_user_t, pthdb_symbol_t *, int)
static int pdc_read_data (pthdb_user_t, void *, pthdb_addr_t, size_t)
static int pdc_write_data (pthdb_user_t, void *, pthdb_addr_t, size_t)
static int pdc_read_regs (pthdb_user_t user, pthdb_tid_t tid, unsigned long long flags, pthdb_context_t *context)
static int pdc_write_regs (pthdb_user_t user, pthdb_tid_t tid, unsigned long long flags, pthdb_context_t *context)
static int pdc_alloc (pthdb_user_t, size_t, void **)
static int pdc_realloc (pthdb_user_t, void *, size_t, void **)
static int pdc_dealloc (pthdb_user_t, void *)
static char * pd_status2str (int status)
static int ptrace_check (int req, int id, int ret)
static int ptrace64aix (int req, int id, long long addr, int data, int *buf)
static int ptrace32 (int req, int id, addr_ptr addr, int data, int *buf)
static void pid_to_prc (ptid_t *ptidp)
static char * state2str (pthdb_state_t state)
static int pcmp (const void *p1v, const void *p2v)
static int giter_count (struct thread_info *thread, void *countp)
static int giter_accum (struct thread_info *thread, void *bufp)
static int ptid_cmp (ptid_t ptid1, ptid_t ptid2)
static int gcmp (const void *t1v, const void *t2v)
static pthdb_tid_t get_signaled_thread (void)
static void sync_threadlists (void)
static int iter_tid (struct thread_info *thread, void *tidp)
static ptid_t pd_update (int set_infpid)
static ptid_t pd_activate (int set_infpid)
static void pd_deactivate (void)
static void pd_enable (void)
static void pd_disable (void)
static void new_objfile (struct objfile *objfile)
static void aix_thread_attach (struct target_ops *ops, char *args, int from_tty)
static void aix_thread_detach (struct target_ops *ops, char *args, int from_tty)
static void aix_thread_resume (struct target_ops *ops, ptid_t ptid, int step, enum gdb_signal sig)
static ptid_t aix_thread_wait (struct target_ops *ops, ptid_t ptid, struct target_waitstatus *status, int options)
static void supply_gprs64 (struct regcache *regcache, uint64_t *vals)
static void supply_reg32 (struct regcache *regcache, int regno, uint32_t val)
static void supply_fprs (struct regcache *regcache, double *vals)
static int special_register_p (struct gdbarch *gdbarch, int regno)
static void supply_sprs64 (struct regcache *regcache, uint64_t iar, uint64_t msr, uint32_t cr, uint64_t lr, uint64_t ctr, uint32_t xer, uint32_t fpscr)
static void supply_sprs32 (struct regcache *regcache, uint32_t iar, uint32_t msr, uint32_t cr, uint32_t lr, uint32_t ctr, uint32_t xer, uint32_t fpscr)
static void fetch_regs_user_thread (struct regcache *regcache, pthdb_pthread_t pdtid)
static void fetch_regs_kernel_thread (struct regcache *regcache, int regno, pthdb_tid_t tid)
static void aix_thread_fetch_registers (struct target_ops *ops, struct regcache *regcache, int regno)
static void fill_gprs64 (const struct regcache *regcache, uint64_t *vals)
static void fill_gprs32 (const struct regcache *regcache, uint32_t *vals)
static void fill_fprs (const struct regcache *regcache, double *vals)
static void fill_sprs64 (const struct regcache *regcache, uint64_t *iar, uint64_t *msr, uint32_t *cr, uint64_t *lr, uint64_t *ctr, uint32_t *xer, uint32_t *fpscr)
static void fill_sprs32 (const struct regcache *regcache, uint32_t *iar, uint32_t *msr, uint32_t *cr, uint32_t *lr, uint32_t *ctr, uint32_t *xer, uint32_t *fpscr)
static void store_regs_user_thread (const struct regcache *regcache, pthdb_pthread_t pdtid)
static void store_regs_kernel_thread (const struct regcache *regcache, int regno, pthdb_tid_t tid)
static void aix_thread_store_registers (struct target_ops *ops, struct regcache *regcache, int regno)
static LONGEST aix_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 aix_thread_mourn_inferior (struct target_ops *ops)
static int aix_thread_thread_alive (struct target_ops *ops, ptid_t ptid)
static char * aix_thread_pid_to_str (struct target_ops *ops, ptid_t ptid)
static char * aix_thread_extra_thread_info (struct thread_info *thread)
static ptid_t aix_thread_get_ada_task_ptid (long lwp, long thread)
static void init_aix_thread_ops (void)
void _initialize_aix_thread (void)

Variables

static int debug_aix_thread
static struct target_ops aix_thread_ops
static CORE_ADDR pd_brk_addr
static int pd_able = 0
static int pd_active = 0
static int arch64
static pthdb_callbacks_t pd_callbacks
static pthdb_session_t pd_session

Define Documentation

#define addr_ptr   int *
#define PD_TID (   ptid)    (pd_active && ptid_get_tid (ptid) != 0)
#define PD_USER   1

Definition at line 79 of file aix-thread.c.

Referenced by pd_activate(), and pd_enable().

#define PDC_FAILURE   PTHDB_CALLBACK

Definition at line 84 of file aix-thread.c.

Referenced by pdc_alloc(), pdc_read_data(), pdc_realloc(), pdc_symbol_addrs(), and pdc_write_data().

#define PDC_SUCCESS   PTHDB_SUCCESS
#define pthdb_tid_t   tid_t

Function Documentation

void _initialize_aix_thread ( void  )
static void aix_thread_attach ( struct target_ops ops,
char *  args,
int  from_tty 
) [static]
static void aix_thread_detach ( struct target_ops ops,
char *  args,
int  from_tty 
) [static]
static char* aix_thread_extra_thread_info ( struct thread_info thread) [static]
static void aix_thread_fetch_registers ( struct target_ops ops,
struct regcache regcache,
int  regno 
) [static]
static ptid_t aix_thread_get_ada_task_ptid ( long  lwp,
long  thread 
) [static]

Definition at line 1810 of file aix-thread.c.

References inferior_ptid, ptid_build(), and ptid_get_pid().

Referenced by init_aix_thread_ops().

static void aix_thread_mourn_inferior ( struct target_ops ops) [static]
static char* aix_thread_pid_to_str ( struct target_ops ops,
ptid_t  ptid 
) [static]
static void aix_thread_resume ( struct target_ops ops,
ptid_t  ptid,
int  step,
enum gdb_signal  sig 
) [static]
static void aix_thread_store_registers ( struct target_ops ops,
struct regcache regcache,
int  regno 
) [static]
static int aix_thread_thread_alive ( struct target_ops ops,
ptid_t  ptid 
) [static]
static ptid_t aix_thread_wait ( struct target_ops ops,
ptid_t  ptid,
struct target_waitstatus status,
int  options 
) [static]
static LONGEST aix_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 void fetch_regs_kernel_thread ( struct regcache regcache,
int  regno,
pthdb_tid_t  tid 
) [static]
static void fetch_regs_user_thread ( struct regcache regcache,
pthdb_pthread_t  pdtid 
) [static]
static void fill_fprs ( const struct regcache regcache,
double *  vals 
) [static]
static void fill_gprs32 ( const struct regcache regcache,
uint32_t *  vals 
) [static]
static void fill_gprs64 ( const struct regcache regcache,
uint64_t *  vals 
) [static]
static void fill_sprs32 ( const struct regcache regcache,
uint32_t *  iar,
uint32_t *  msr,
uint32_t *  cr,
uint32_t *  lr,
uint32_t *  ctr,
uint32_t *  xer,
uint32_t *  fpscr 
) [static]
static void fill_sprs64 ( const struct regcache regcache,
uint64_t *  iar,
uint64_t *  msr,
uint32_t *  cr,
uint64_t *  lr,
uint64_t *  ctr,
uint32_t *  xer,
uint32_t *  fpscr 
) [static]
static int gcmp ( const void *  t1v,
const void *  t2v 
) [static]

Definition at line 646 of file aix-thread.c.

References thread_info::ptid, and ptid_cmp().

Referenced by sync_threadlists().

static pthdb_tid_t get_signaled_thread ( void  ) [static]

Definition at line 658 of file aix-thread.c.

References getthrds(), inferior_ptid, and ptid_get_pid().

Referenced by pd_update().

int getthrds ( pid_t  ,
struct thrdsinfo64 *  ,
int  ,
tid_t *  ,
int   
)

Referenced by get_signaled_thread().

static int giter_accum ( struct thread_info thread,
void *  bufp 
) [static]

Definition at line 610 of file aix-thread.c.

References PD_TID, and thread_info::ptid.

Referenced by sync_threadlists().

static int giter_count ( struct thread_info thread,
void *  countp 
) [static]

Definition at line 595 of file aix-thread.c.

References PD_TID, and thread_info::ptid.

Referenced by sync_threadlists().

static void init_aix_thread_ops ( void  ) [static]
static int iter_tid ( struct thread_info thread,
void *  tidp 
) [static]

Definition at line 808 of file aix-thread.c.

References thread_info::private, pthdb_tid_t, and private_thread_info::tid.

Referenced by pd_update().

static void new_objfile ( struct objfile objfile) [static]

Definition at line 948 of file aix-thread.c.

References pd_disable(), and pd_enable().

Referenced by _initialize_aix_thread(), and symbol_file_add_separate().

static int pcmp ( const void *  p1v,
const void *  p2v 
) [static]

Definition at line 580 of file aix-thread.c.

References pd_thread::pthid.

Referenced by sync_threadlists().

static ptid_t pd_activate ( int  set_infpid) [static]
static void pd_deactivate ( void  ) [static]

Definition at line 875 of file aix-thread.c.

References inferior_ptid, pd_active, pd_session, and pid_to_prc().

Referenced by aix_thread_mourn_inferior(), and pd_disable().

static void pd_disable ( void  ) [static]

Definition at line 930 of file aix-thread.c.

References aix_thread_ops, pd_able, pd_active, pd_deactivate(), and unpush_target().

Referenced by aix_thread_detach(), and new_objfile().

static void pd_enable ( void  ) [static]
static char* pd_status2str ( int  status) [static]
static ptid_t pd_update ( int  set_infpid) [static]
static int pdc_alloc ( pthdb_user_t  user,
size_t  len,
void **  bufp 
) [static]
static int pdc_dealloc ( pthdb_user_t  user,
void *  buf 
) [static]

Definition at line 539 of file aix-thread.c.

References debug_aix_thread, fprintf_unfiltered(), gdb_stdlog, PDC_SUCCESS, and xfree().

static int pdc_read_data ( pthdb_user_t  user,
void *  buf,
pthdb_addr_t  addr,
size_t  len 
) [static]
static int pdc_read_regs ( pthdb_user_t  user,
pthdb_tid_t  tid,
unsigned long long  flags,
pthdb_context_t *  context 
) [static]
static int pdc_realloc ( pthdb_user_t  user,
void *  buf,
size_t  len,
void **  bufp 
) [static]
static int pdc_symbol_addrs ( pthdb_user_t  user,
pthdb_symbol_t *  symbols,
int  count 
) [static]
static int pdc_write_data ( pthdb_user_t  user,
void *  buf,
pthdb_addr_t  addr,
size_t  len 
) [static]
static int pdc_write_regs ( pthdb_user_t  user,
pthdb_tid_t  tid,
unsigned long long  flags,
pthdb_context_t *  context 
) [static]
static void pid_to_prc ( ptid_t ptidp) [static]

Definition at line 274 of file aix-thread.c.

References PD_TID, pid_to_ptid(), and ptid_get_pid().

Referenced by aix_thread_wait(), and pd_deactivate().

static int ptid_cmp ( ptid_t  ptid1,
ptid_t  ptid2 
) [static]

Definition at line 623 of file aix-thread.c.

References ptid_get_lwp(), ptid_get_pid(), and ptid_get_tid().

Referenced by gcmp(), and sync_threadlists().

static int ptrace32 ( int  req,
int  id,
addr_ptr  addr,
int  data,
int buf 
) [static]
static int ptrace64aix ( int  req,
int  id,
long long  addr,
int  data,
int buf 
) [static]
static int ptrace_check ( int  req,
int  id,
int  ret 
) [static]

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

References _, debug_aix_thread, error(), fprintf_unfiltered(), gdb_stdlog, and safe_strerror().

Referenced by ptrace32(), and ptrace64aix().

static int special_register_p ( struct gdbarch gdbarch,
int  regno 
) [static]
static char* state2str ( pthdb_state_t  state) [static]

Definition at line 552 of file aix-thread.c.

References _.

Referenced by aix_thread_extra_thread_info().

static void store_regs_kernel_thread ( const struct regcache regcache,
int  regno,
pthdb_tid_t  tid 
) [static]
static void store_regs_user_thread ( const struct regcache regcache,
pthdb_pthread_t  pdtid 
) [static]
static void supply_fprs ( struct regcache regcache,
double *  vals 
) [static]
static void supply_gprs64 ( struct regcache regcache,
uint64_t *  vals 
) [static]
static void supply_reg32 ( struct regcache regcache,
int  regno,
uint32_t  val 
) [static]

Definition at line 1070 of file aix-thread.c.

References regcache_raw_supply().

Referenced by fetch_regs_kernel_thread(), and fetch_regs_user_thread().

static void supply_sprs32 ( struct regcache regcache,
uint32_t  iar,
uint32_t  msr,
uint32_t  cr,
uint32_t  lr,
uint32_t  ctr,
uint32_t  xer,
uint32_t  fpscr 
) [static]
static void supply_sprs64 ( struct regcache regcache,
uint64_t  iar,
uint64_t  msr,
uint32_t  cr,
uint64_t  lr,
uint64_t  ctr,
uint32_t  xer,
uint32_t  fpscr 
) [static]
static void sync_threadlists ( void  ) [static]

Variable Documentation

struct target_ops aix_thread_ops [static]

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

Referenced by _initialize_aix_thread(), init_aix_thread_ops(), pd_disable(), and pd_enable().

int arch64 [static]
int pd_able = 0 [static]

Definition at line 112 of file aix-thread.c.

Referenced by pd_disable(), and pd_enable().

int pd_active = 0 [static]

Definition at line 116 of file aix-thread.c.

Referenced by aix_thread_wait(), pd_activate(), pd_deactivate(), pd_disable(), and pd_update().

Definition at line 108 of file aix-thread.c.

Referenced by aix_thread_wait(), and pd_enable().

pthdb_callbacks_t pd_callbacks [static]
pthdb_session_t pd_session [static]
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines