GDB (xrefs)
|
#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_info * | get_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_variables * | get_aix_thread_variables_data (struct inferior *inf) |
static struct aix_thread_variables * | get_thread_data_helper_for_ptid (ptid_t ptid) |
static struct aix_thread_variables * | get_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_variables > | aix_thread_variables_handle |
#define addr_ptr int * |
Definition at line 345 of file aix-thread.c.
Referenced by aix_thread_target::resume().
#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().
#define PDC_SUCCESS PTHDB_SUCCESS |
Definition at line 73 of file aix-thread.c.
Referenced by pdc_alloc(), pdc_dealloc(), pdc_read_data(), pdc_realloc(), pdc_symbol_addrs(), and pdc_write_data().
#define pthdb_tid_t tid_t |
Definition at line 68 of file aix-thread.c.
Referenced by aix_thread_target::extra_thread_info(), aix_thread_target::fetch_registers(), iter_tid(), pd_update(), aix_thread_target::resume(), aix_thread_target::store_registers(), and sync_threadlists().
void _initialize_aix_thread | ( | ) |
Definition at line 2160 of file aix-thread.c.
References add_setshow_boolean_cmd(), aix_thread_inferior_created(), class_maintenance, debug_aix_thread, gdb::observers::inferior_created, new_objfile(), gdb::observers::new_objfile, setdebuglist, and showdebuglist.
|
static |
Definition at line 1124 of file aix-thread.c.
References pd_enable().
Referenced by _initialize_aix_thread().
|
static |
Definition at line 1426 of file aix-thread.c.
References reg_buffer::arch(), debug_aix_thread, gdb_printf(), gdb_stdlog, get_thread_data_helper_for_ptid(), ppc_floating_point_unit_p(), ppc_gdbarch_tdep::ppc_fp0_regnum, ppc_gdbarch_tdep::ppc_gp0_regnum, ppc_gdbarch_tdep::ppc_mq_regnum, ppc_num_fprs, ppc_num_gprs, ppc_num_vrs, ppc_num_vshrs, ppc_gdbarch_tdep::ppc_vr0_regnum, ppc_gdbarch_tdep::ppc_vrsave_regnum, ppc_gdbarch_tdep::ppc_vsr0_upper_regnum, regcache::ptid(), ptrace32(), ptrace64aix(), reg_buffer::raw_supply(), special_register_p(), supply_fprs(), supply_gprs64(), supply_reg32(), supply_sprs32(), and supply_sprs64().
Referenced by aix_thread_target::fetch_registers().
|
static |
Definition at line 1364 of file aix-thread.c.
References reg_buffer::arch(), debug_aix_thread, gdb_printf(), gdb_stdlog, get_thread_data_helper_for_ptid(), inferior_ptid, pd_status2str(), ppc_floating_point_unit_p(), ppc_gdbarch_tdep::ppc_gp0_regnum, ppc_num_gprs, status, supply_altivec_regs(), supply_fprs(), supply_gprs64(), supply_reg32(), supply_sprs32(), supply_sprs64(), and supply_vsx_regs().
Referenced by aix_thread_target::fetch_registers().
|
static |
Definition at line 1569 of file aix-thread.c.
References reg_buffer::arch(), reg_buffer::get_register_status(), ppc_num_vrs, ppc_gdbarch_tdep::ppc_vr0_regnum, ppc_gdbarch_tdep::ppc_vrsave_regnum, and reg_buffer::raw_collect().
Referenced by store_regs_kernel_thread().
|
static |
Definition at line 1631 of file aix-thread.c.
References reg_buffer::arch(), reg_buffer::get_register_status(), ppc_floating_point_unit_p(), ppc_gdbarch_tdep::ppc_fp0_regnum, ppc_num_fprs, and reg_buffer::raw_collect().
Referenced by store_regs_kernel_thread(), and store_regs_user_thread().
|
static |
Definition at line 1617 of file aix-thread.c.
References reg_buffer::arch(), reg_buffer::get_register_status(), ppc_gdbarch_tdep::ppc_gp0_regnum, ppc_num_gprs, and reg_buffer::raw_collect().
Referenced by store_regs_kernel_thread().
|
static |
Definition at line 1604 of file aix-thread.c.
References reg_buffer::arch(), reg_buffer::get_register_status(), ppc_gdbarch_tdep::ppc_gp0_regnum, ppc_num_gprs, and reg_buffer::raw_collect().
Referenced by store_regs_kernel_thread().
|
static |
Definition at line 1686 of file aix-thread.c.
References reg_buffer::arch(), gdbarch_pc_regnum(), reg_buffer::get_register_status(), ppc_gdbarch_tdep::ppc_cr_regnum, ppc_gdbarch_tdep::ppc_ctr_regnum, ppc_gdbarch_tdep::ppc_fpscr_regnum, ppc_gdbarch_tdep::ppc_lr_regnum, ppc_gdbarch_tdep::ppc_ps_regnum, ppc_gdbarch_tdep::ppc_xer_regnum, reg_buffer::raw_collect(), and register_size().
Referenced by store_regs_kernel_thread(), and store_regs_user_thread().
|
static |
Definition at line 1652 of file aix-thread.c.
References reg_buffer::arch(), gdbarch_pc_regnum(), reg_buffer::get_register_status(), ppc_gdbarch_tdep::ppc_cr_regnum, ppc_gdbarch_tdep::ppc_ctr_regnum, ppc_gdbarch_tdep::ppc_fpscr_regnum, ppc_gdbarch_tdep::ppc_lr_regnum, ppc_gdbarch_tdep::ppc_ps_regnum, ppc_gdbarch_tdep::ppc_xer_regnum, reg_buffer::raw_collect(), and register_size().
Referenced by store_regs_kernel_thread(), and store_regs_user_thread().
|
static |
Definition at line 1589 of file aix-thread.c.
References reg_buffer::arch(), reg_buffer::get_register_status(), ppc_num_vshrs, ppc_gdbarch_tdep::ppc_vsr0_upper_regnum, and reg_buffer::raw_collect().
Referenced by store_regs_kernel_thread().
|
static |
Definition at line 772 of file aix-thread.c.
References thread_info::ptid, and ptid_cmp().
Referenced by sync_threadlists().
|
static |
Definition at line 87 of file aix-thread.c.
References thread_info::priv.
Referenced by aix_thread_target::extra_thread_info(), aix_thread_target::fetch_registers(), iter_tid(), aix_thread_target::resume(), aix_thread_target::store_registers(), and sync_threadlists().
|
static |
Definition at line 199 of file aix-thread.c.
References aix_thread_variables_handle, and registry< T >::get().
Referenced by get_thread_data_helper_for_pid(), get_thread_data_helper_for_ptid(), pd_disable(), and pd_enable().
|
static |
Definition at line 784 of file aix-thread.c.
References getthrds(), and pid.
Referenced by pd_update().
|
static |
Definition at line 226 of file aix-thread.c.
References current_inferior(), find_inferior_pid(), get_aix_thread_variables_data(), and pid.
Referenced by pd_activate(), pd_update(), pdc_read_regs(), pdc_write_regs(), and sync_threadlists().
|
static |
Definition at line 216 of file aix-thread.c.
References current_inferior(), find_inferior_ptid(), and get_aix_thread_variables_data().
Referenced by aix_thread_target::extra_thread_info(), fetch_regs_kernel_thread(), fetch_regs_user_thread(), aix_thread_target::resume(), store_regs_kernel_thread(), store_regs_user_thread(), and aix_thread_target::wait().
|
extern |
Referenced by get_signaled_thread().
|
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().
|
static |
Definition at line 1116 of file aix-thread.c.
References current_inferior(), and pd_enable().
Referenced by _initialize_aix_thread().
|
static |
Definition at line 741 of file aix-thread.c.
References pd_thread::pthid.
Referenced by sync_threadlists().
|
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().
|
static |
Definition at line 1093 of file aix-thread.c.
References aix_thread_ops, current_inferior(), get_aix_thread_variables_data(), inferior_ptid, pid_to_prc(), and inferior::unpush_target().
Referenced by aix_thread_target::detach(), and aix_thread_target::mourn_inferior().
|
static |
Definition at line 1040 of file aix-thread.c.
References aix_thread_ops, create_thread_event_breakpoint(), current_inferior(), get_aix_thread_variables_data(), lookup_minimal_symbol(), bound_minimal_symbol::minsym, pd_activate(), pd_callbacks, inf::pid, inferior::push_target(), register_size(), status, target_gdbarch(), and bound_minimal_symbol::value_address().
Referenced by aix_thread_inferior_created(), and new_objfile().
|
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().
|
static |
Definition at line 982 of file aix-thread.c.
References get_signaled_thread(), get_thread_data_helper_for_pid(), iter_tid(), iterate_over_threads(), pid, pthdb_tid_t, thread_info::ptid, status, sync_threadlists(), and pd_thread::tid.
Referenced by pd_activate(), and aix_thread_target::wait().
|
static |
Definition at line 661 of file aix-thread.c.
References debug_aix_thread, gdb_printf(), gdb_stdlog, PDC_FAILURE, PDC_SUCCESS, and xmalloc().
|
static |
Definition at line 700 of file aix-thread.c.
References debug_aix_thread, gdb_printf(), gdb_stdlog, PDC_SUCCESS, and xfree().
|
static |
Definition at line 603 of file aix-thread.c.
References current_inferior(), debug_aix_thread, find_inferior_pid(), gdb_printf(), gdb_stdlog, pd_status2str(), PDC_FAILURE, PDC_SUCCESS, status, and target_read_memory().
|
static |
Definition at line 420 of file aix-thread.c.
References debug_aix_thread, flags, gdb_printf(), gdb_stdlog, get_thread_data_helper_for_pid(), ppc_num_fprs, ppc_num_gprs, ptrace32(), and ptrace64aix().
|
static |
Definition at line 683 of file aix-thread.c.
References debug_aix_thread, gdb_printf(), gdb_stdlog, PDC_FAILURE, PDC_SUCCESS, and xrealloc().
|
static |
Definition at line 373 of file aix-thread.c.
References debug_aix_thread, gdb_printf(), gdb_stdlog, lookup_minimal_symbol(), bound_minimal_symbol::minsym, name, PDC_FAILURE, PDC_SUCCESS, and bound_minimal_symbol::value_address().
|
static |
Definition at line 632 of file aix-thread.c.
References current_inferior(), debug_aix_thread, find_inferior_pid(), gdb_printf(), gdb_stdlog, pd_status2str(), PDC_FAILURE, PDC_SUCCESS, status, and target_write_memory().
|
static |
Definition at line 531 of file aix-thread.c.
References debug_aix_thread, flags, gdb_printf(), gdb_stdlog, get_thread_data_helper_for_pid(), ptrace32(), and ptrace64aix().
|
static |
Definition at line 360 of file aix-thread.c.
Referenced by pd_disable(), and aix_thread_target::wait().
|
static |
Definition at line 751 of file aix-thread.c.
Referenced by gcmp(), and sync_threadlists().
|
static |
Definition at line 349 of file aix-thread.c.
References ptrace, and ptrace_check().
Referenced by fetch_regs_kernel_thread(), pdc_read_regs(), pdc_write_regs(), aix_thread_target::resume(), and store_regs_kernel_thread().
|
static |
Definition at line 330 of file aix-thread.c.
References ptrace_check().
Referenced by fetch_regs_kernel_thread(), pdc_read_regs(), pdc_write_regs(), aix_thread_target::resume(), and store_regs_kernel_thread().
|
static |
Definition at line 281 of file aix-thread.c.
References debug_aix_thread, gdb_printf(), and gdb_stdlog.
Referenced by ptrace32(), and ptrace64aix().
|
static |
Definition at line 1297 of file aix-thread.c.
References gdbarch_pc_regnum(), ppc_gdbarch_tdep::ppc_cr_regnum, ppc_gdbarch_tdep::ppc_ctr_regnum, ppc_gdbarch_tdep::ppc_fpscr_regnum, ppc_gdbarch_tdep::ppc_lr_regnum, ppc_gdbarch_tdep::ppc_mq_regnum, ppc_gdbarch_tdep::ppc_ps_regnum, and ppc_gdbarch_tdep::ppc_xer_regnum.
Referenced by fetch_regs_kernel_thread(), and store_regs_kernel_thread().
|
static |
Definition at line 713 of file aix-thread.c.
Referenced by aix_thread_target::extra_thread_info().
|
static |
Definition at line 1852 of file aix-thread.c.
References reg_buffer::arch(), debug_aix_thread, fill_altivec(), fill_fprs(), fill_gprs32(), fill_gprs64(), fill_sprs32(), fill_sprs64(), fill_vsx(), gdb_printf(), gdb_stdlog, reg_buffer::get_register_status(), get_thread_data_helper_for_ptid(), ppc_floating_point_unit_p(), ppc_gdbarch_tdep::ppc_fp0_regnum, ppc_gdbarch_tdep::ppc_gp0_regnum, ppc_gdbarch_tdep::ppc_mq_regnum, ppc_num_fprs, ppc_num_gprs, ppc_num_vshrs, ppc_gdbarch_tdep::ppc_vr0_regnum, ppc_gdbarch_tdep::ppc_vrsave_regnum, ppc_gdbarch_tdep::ppc_vsr0_upper_regnum, regcache::ptid(), ptrace32(), ptrace64aix(), reg_buffer::raw_collect(), and special_register_p().
Referenced by aix_thread_target::store_registers().
|
static |
Definition at line 1726 of file aix-thread.c.
References reg_buffer::arch(), debug_aix_thread, fill_fprs(), fill_sprs32(), fill_sprs64(), gdb_printf(), gdb_stdlog, gdbarch_pc_regnum(), reg_buffer::get_register_status(), get_thread_data_helper_for_ptid(), inferior_ptid, pd_status2str(), ppc_gdbarch_tdep::ppc_cr_regnum, ppc_gdbarch_tdep::ppc_ctr_regnum, ppc_floating_point_unit_p(), ppc_gdbarch_tdep::ppc_gp0_regnum, ppc_gdbarch_tdep::ppc_lr_regnum, ppc_num_gprs, ppc_num_vrs, ppc_num_vshrs, ppc_gdbarch_tdep::ppc_ps_regnum, ppc_gdbarch_tdep::ppc_vr0_regnum, ppc_gdbarch_tdep::ppc_vrsave_regnum, ppc_gdbarch_tdep::ppc_vsr0_regnum, ppc_gdbarch_tdep::ppc_xer_regnum, reg_buffer::raw_collect(), and status.
Referenced by aix_thread_target::store_registers().
|
static |
Definition at line 1227 of file aix-thread.c.
References reg_buffer::arch(), ppc_num_vrs, ppc_gdbarch_tdep::ppc_vr0_regnum, ppc_gdbarch_tdep::ppc_vrsave_regnum, and reg_buffer::raw_supply().
Referenced by fetch_regs_user_thread().
|
static |
Definition at line 1278 of file aix-thread.c.
References reg_buffer::arch(), ppc_floating_point_unit_p(), ppc_gdbarch_tdep::ppc_fp0_regnum, ppc_num_fprs, and reg_buffer::raw_supply().
Referenced by fetch_regs_kernel_thread(), and fetch_regs_user_thread().
|
static |
Definition at line 1256 of file aix-thread.c.
References reg_buffer::arch(), ppc_gdbarch_tdep::ppc_gp0_regnum, ppc_num_gprs, and reg_buffer::raw_supply().
Referenced by fetch_regs_kernel_thread(), and fetch_regs_user_thread().
|
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().
|
static |
Definition at line 1338 of file aix-thread.c.
References reg_buffer::arch(), gdbarch_pc_regnum(), ppc_gdbarch_tdep::ppc_cr_regnum, ppc_gdbarch_tdep::ppc_ctr_regnum, ppc_gdbarch_tdep::ppc_fpscr_regnum, ppc_gdbarch_tdep::ppc_lr_regnum, ppc_gdbarch_tdep::ppc_ps_regnum, ppc_gdbarch_tdep::ppc_xer_regnum, and reg_buffer::raw_supply().
Referenced by fetch_regs_kernel_thread(), and fetch_regs_user_thread().
|
static |
Definition at line 1316 of file aix-thread.c.
References reg_buffer::arch(), gdbarch_pc_regnum(), ppc_gdbarch_tdep::ppc_cr_regnum, ppc_gdbarch_tdep::ppc_ctr_regnum, ppc_gdbarch_tdep::ppc_fpscr_regnum, ppc_gdbarch_tdep::ppc_lr_regnum, ppc_gdbarch_tdep::ppc_ps_regnum, ppc_gdbarch_tdep::ppc_xer_regnum, and reg_buffer::raw_supply().
Referenced by fetch_regs_kernel_thread(), and fetch_regs_user_thread().
|
static |
Definition at line 1242 of file aix-thread.c.
References reg_buffer::arch(), ppc_num_vshrs, ppc_gdbarch_tdep::ppc_vsr0_upper_regnum, and reg_buffer::raw_supply().
Referenced by fetch_regs_user_thread().
|
static |
Definition at line 820 of file aix-thread.c.
References add_thread(), add_thread_with_info(), all_threads(), current_inferior(), delete_thread(), process_stratum_target::find_thread(), gcmp(), get_aix_thread_info(), get_thread_data_helper_for_pid(), pcmp(), aix_thread_info::pdtid, pd_thread::pdtid, pid, thread_info::priv, inferior::process_target(), pthdb_tid_t, pd_thread::pthid, thread_info::ptid, ptid_cmp(), qsort, status, thread_change_ptid(), aix_thread_info::tid, pd_thread::tid, xfree(), and xrealloc().
Referenced by pd_update().
|
static |
Definition at line 141 of file aix-thread.c.
Referenced by pd_disable(), and pd_enable().
|
static |
Definition at line 102 of file aix-thread.c.
Referenced by aix_thread_target::info().
|
static |
Definition at line 195 of file aix-thread.c.
Referenced by get_aix_thread_variables_data().
|
static |
Definition at line 64 of file aix-thread.c.
Referenced by _initialize_aix_thread(), fetch_regs_kernel_thread(), fetch_regs_user_thread(), pdc_alloc(), pdc_dealloc(), pdc_read_data(), pdc_read_regs(), pdc_realloc(), pdc_symbol_addrs(), pdc_write_data(), pdc_write_regs(), ptrace_check(), store_regs_kernel_thread(), and store_regs_user_thread().
|
static |
Definition at line 160 of file aix-thread.c.
Referenced by pd_activate(), and pd_enable().