GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Macros | Functions | Variables
aix-thread.c File Reference
#include "defs.h"
#include "gdbthread.h"
#include "target.h"
#include "inferior.h"
#include "regcache.h"
#include "gdbcmd.h"
#include "ppc-tdep.h"
#include "observable.h"
#include "objfiles.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  aix_thread_info
 
struct  pd_thread
 
class  aix_thread_target
 
struct  aix_thread_variables
 

Macros

#define pthdb_tid_t   tid_t
 
#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 aix_thread_infoget_aix_thread_info (thread_info *thread)
 
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 struct aix_thread_variablesget_aix_thread_variables_data (struct inferior *inf)
 
static struct aix_thread_variablesget_thread_data_helper_for_ptid (ptid_t ptid)
 
static struct aix_thread_variablesget_thread_data_helper_for_pid (pid_t pid)
 
static const 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 ptid_cmp (ptid_t ptid1, ptid_t ptid2)
 
static int gcmp (const void *t1v, const void *t2v)
 
static pthdb_tid_t get_signaled_thread (int pid)
 
static void sync_threadlists (pid_t pid)
 
static int iter_tid (struct thread_info *thread, void *tidp)
 
static ptid_t pd_update (pid_t pid)
 
static ptid_t pd_activate (pid_t pid)
 
static void pd_enable (inferior *inf)
 
static void pd_disable (inferior *inf)
 
static void new_objfile (struct objfile *objfile)
 
static void aix_thread_inferior_created (inferior *inf)
 
static void supply_altivec_regs (struct regcache *regcache, __vmx_context_t vmx)
 
static void supply_vsx_regs (struct regcache *regcache, __vsx_context_t vsx)
 
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 fill_altivec (const struct regcache *regcache, __vmx_context_t *vmx)
 
static void fill_vsx (const struct regcache *regcache, __vsx_context_t *vsx)
 
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)
 
void _initialize_aix_thread ()
 

Variables

static bool debug_aix_thread
 
static const target_info aix_thread_target_info
 
static aix_thread_target aix_thread_ops
 
static pthdb_callbacks_t pd_callbacks
 
static const registry< inferior >::key< aix_thread_variablesaix_thread_variables_handle
 

Macro Definition Documentation

◆ addr_ptr

#define addr_ptr   int *

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

Referenced by aix_thread_target::resume().

◆ PDC_FAILURE

#define PDC_FAILURE   PTHDB_CALLBACK

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

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

◆ PDC_SUCCESS

#define PDC_SUCCESS   PTHDB_SUCCESS

◆ pthdb_tid_t

#define pthdb_tid_t   tid_t

Function Documentation

◆ _initialize_aix_thread()

void _initialize_aix_thread ( )

◆ aix_thread_inferior_created()

static void aix_thread_inferior_created ( inferior * inf)
static

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

References pd_enable().

Referenced by _initialize_aix_thread().

◆ fetch_regs_kernel_thread()

static void fetch_regs_kernel_thread ( struct regcache * regcache,
int regno,
pthdb_tid_t tid )
static

◆ fetch_regs_user_thread()

static void fetch_regs_user_thread ( struct regcache * regcache,
pthdb_pthread_t pdtid )
static

◆ fill_altivec()

static void fill_altivec ( const struct regcache * regcache,
__vmx_context_t * vmx )
static

◆ fill_fprs()

static void fill_fprs ( const struct regcache * regcache,
double * vals )
static

◆ fill_gprs32()

static void fill_gprs32 ( const struct regcache * regcache,
uint32_t * vals )
static

◆ fill_gprs64()

static void fill_gprs64 ( const struct regcache * regcache,
uint64_t * vals )
static

◆ fill_sprs32()

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

◆ fill_sprs64()

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

◆ fill_vsx()

static void fill_vsx ( const struct regcache * regcache,
__vsx_context_t * vsx )
static

◆ gcmp()

static int gcmp ( const void * t1v,
const void * t2v )
static

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

References thread_info::ptid, and ptid_cmp().

Referenced by sync_threadlists().

◆ get_aix_thread_info()

static aix_thread_info * get_aix_thread_info ( thread_info * thread)
static

◆ get_aix_thread_variables_data()

static struct aix_thread_variables * get_aix_thread_variables_data ( struct inferior * inf)
static

◆ get_signaled_thread()

static pthdb_tid_t get_signaled_thread ( int pid)
static

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

References getthrds(), and pid.

Referenced by pd_update().

◆ get_thread_data_helper_for_pid()

static struct aix_thread_variables * get_thread_data_helper_for_pid ( pid_t pid)
static

◆ get_thread_data_helper_for_ptid()

static struct aix_thread_variables * get_thread_data_helper_for_ptid ( ptid_t ptid)
static

◆ getthrds()

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

Referenced by get_signaled_thread().

◆ iter_tid()

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

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

References get_aix_thread_info(), pthdb_tid_t, aix_thread_info::tid, and pd_thread::tid.

Referenced by pd_update().

◆ new_objfile()

static void new_objfile ( struct objfile * objfile)
static

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

References current_inferior(), and pd_enable().

Referenced by _initialize_aix_thread().

◆ pcmp()

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

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

References pd_thread::pthid.

Referenced by sync_threadlists().

◆ pd_activate()

static ptid_t pd_activate ( pid_t pid)
static

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

References get_thread_data_helper_for_pid(), pd_callbacks, pd_update(), pid, and status.

Referenced by pd_enable(), and aix_thread_target::wait().

◆ pd_disable()

static void pd_disable ( inferior * inf)
static

◆ pd_enable()

static void pd_enable ( inferior * inf)
static

◆ pd_status2str()

static const char * pd_status2str ( int status)
static

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

References status.

Referenced by fetch_regs_user_thread(), pdc_read_data(), pdc_write_data(), and store_regs_user_thread().

◆ pd_update()

static ptid_t pd_update ( pid_t pid)
static

◆ pdc_alloc()

static int pdc_alloc ( pthdb_user_t user_current_pid,
size_t len,
void ** bufp )
static

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

References debug_aix_thread, gdb_printf(), gdb_stdlog, PDC_FAILURE, PDC_SUCCESS, and xmalloc().

◆ pdc_dealloc()

static int pdc_dealloc ( pthdb_user_t user_current_pid,
void * buf )
static

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

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

◆ pdc_read_data()

static int pdc_read_data ( pthdb_user_t user_current_pid,
void * buf,
pthdb_addr_t addr,
size_t len )
static

◆ pdc_read_regs()

static int pdc_read_regs ( pthdb_user_t user,
pthdb_tid_t tid,
unsigned long long flags,
pthdb_context_t * context )
static

◆ pdc_realloc()

static int pdc_realloc ( pthdb_user_t user_current_pid,
void * buf,
size_t len,
void ** bufp )
static

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

References debug_aix_thread, gdb_printf(), gdb_stdlog, PDC_FAILURE, PDC_SUCCESS, and xrealloc().

◆ pdc_symbol_addrs()

static int pdc_symbol_addrs ( pthdb_user_t user_current_pid,
pthdb_symbol_t * symbols,
int count )
static

◆ pdc_write_data()

static int pdc_write_data ( pthdb_user_t user_current_pid,
void * buf,
pthdb_addr_t addr,
size_t len )
static

◆ pdc_write_regs()

static int pdc_write_regs ( pthdb_user_t user,
pthdb_tid_t tid,
unsigned long long flags,
pthdb_context_t * context )
static

◆ pid_to_prc()

static void pid_to_prc ( ptid_t * ptidp)
static

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

Referenced by pd_disable(), and aix_thread_target::wait().

◆ ptid_cmp()

static int ptid_cmp ( ptid_t ptid1,
ptid_t ptid2 )
static

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

Referenced by gcmp(), and sync_threadlists().

◆ ptrace32()

static int ptrace32 ( int req,
int id,
addr_ptr addr,
int data,
int * buf )
static

◆ ptrace64aix()

static int ptrace64aix ( int req,
int id,
long long addr,
int data,
int * buf )
static

◆ ptrace_check()

static int ptrace_check ( int req,
int id,
int ret )
static

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

References debug_aix_thread, gdb_printf(), and gdb_stdlog.

Referenced by ptrace32(), and ptrace64aix().

◆ special_register_p()

static int special_register_p ( struct gdbarch * gdbarch,
int regno )
static

◆ state2str()

static char * state2str ( pthdb_state_t state)
static

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

Referenced by aix_thread_target::extra_thread_info().

◆ store_regs_kernel_thread()

static void store_regs_kernel_thread ( const struct regcache * regcache,
int regno,
pthdb_tid_t tid )
static

◆ store_regs_user_thread()

static void store_regs_user_thread ( const struct regcache * regcache,
pthdb_pthread_t pdtid )
static

◆ supply_altivec_regs()

static void supply_altivec_regs ( struct regcache * regcache,
__vmx_context_t vmx )
static

◆ supply_fprs()

static void supply_fprs ( struct regcache * regcache,
double * vals )
static

◆ supply_gprs64()

static void supply_gprs64 ( struct regcache * regcache,
uint64_t * vals )
static

◆ supply_reg32()

static void supply_reg32 ( struct regcache * regcache,
int regno,
uint32_t val )
static

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

References reg_buffer::raw_supply().

Referenced by fetch_regs_kernel_thread(), and fetch_regs_user_thread().

◆ supply_sprs32()

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

◆ supply_sprs64()

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

◆ supply_vsx_regs()

static void supply_vsx_regs ( struct regcache * regcache,
__vsx_context_t vsx )
static

◆ sync_threadlists()

static void sync_threadlists ( pid_t pid)
static

Variable Documentation

◆ aix_thread_ops

aix_thread_target aix_thread_ops
static

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

Referenced by pd_disable(), and pd_enable().

◆ aix_thread_target_info

const target_info aix_thread_target_info
static
Initial value:
= {
"aix-threads",
N_("AIX pthread support"),
}

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

Referenced by aix_thread_target::info().

◆ aix_thread_variables_handle

const registry<inferior>::key<aix_thread_variables> aix_thread_variables_handle
static

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

Referenced by get_aix_thread_variables_data().

◆ debug_aix_thread

bool debug_aix_thread
static

◆ pd_callbacks

pthdb_callbacks_t pd_callbacks
static
Initial value:
= {
NULL
}
static int pdc_dealloc(pthdb_user_t, void *)
Definition aix-thread.c:700
static int pdc_symbol_addrs(pthdb_user_t, pthdb_symbol_t *, int)
Definition aix-thread.c:373
static int pdc_write_data(pthdb_user_t, void *, pthdb_addr_t, size_t)
Definition aix-thread.c:632
static int pdc_read_regs(pthdb_user_t user, pthdb_tid_t tid, unsigned long long flags, pthdb_context_t *context)
Definition aix-thread.c:420
static int pdc_alloc(pthdb_user_t, size_t, void **)
Definition aix-thread.c:661
static int pdc_realloc(pthdb_user_t, void *, size_t, void **)
Definition aix-thread.c:683
static int pdc_read_data(pthdb_user_t, void *, pthdb_addr_t, size_t)
Definition aix-thread.c:603
static int pdc_write_regs(pthdb_user_t user, pthdb_tid_t tid, unsigned long long flags, pthdb_context_t *context)
Definition aix-thread.c:531

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

Referenced by pd_activate(), and pd_enable().