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 |
Macros | |
#define | pthdb_tid_t tid_t |
#define | PD_TID(ptid) (pd_active && ptid.tid () != 0) |
#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 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 | 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 (int pid) |
static void | sync_threadlists (int pid) |
static int | iter_tid (struct thread_info *thread, void *tidp) |
static ptid_t | pd_update (int pid) |
static ptid_t | pd_activate (int pid) |
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_inferior_created (inferior *inf) |
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_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 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 addr_ptr int * |
Definition at line 301 of file aix-thread.c.
#define PD_TID | ( | ptid | ) | (pd_active && ptid.tid () != 0) |
Definition at line 73 of file aix-thread.c.
#define PDC_FAILURE PTHDB_CALLBACK |
Definition at line 78 of file aix-thread.c.
#define PDC_SUCCESS PTHDB_SUCCESS |
Definition at line 77 of file aix-thread.c.
#define pthdb_tid_t tid_t |
Definition at line 68 of file aix-thread.c.
void _initialize_aix_thread | ( | ) |
Definition at line 1846 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 1021 of file aix-thread.c.
References pd_enable().
Referenced by _initialize_aix_thread().
|
static |
Definition at line 1280 of file aix-thread.c.
References reg_buffer::arch(), arch64, debug_aix_thread, gdb_printf(), gdb_stdlog, 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, 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 1226 of file aix-thread.c.
References reg_buffer::arch(), arch64, debug_aix_thread, gdb_printf(), gdb_stdlog, pd_session, pd_status2str(), ppc_floating_point_unit_p(), ppc_gdbarch_tdep::ppc_gp0_regnum, ppc_num_gprs, status, supply_fprs(), supply_gprs64(), supply_reg32(), supply_sprs32(), and supply_sprs64().
Referenced by aix_thread_target::fetch_registers().
|
static |
Definition at line 1411 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 1397 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 1384 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 1466 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 1432 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 699 of file aix-thread.c.
References thread_info::ptid, and ptid_cmp().
Referenced by sync_threadlists().
|
static |
Definition at line 91 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 711 of file aix-thread.c.
References getthrds(), and pid.
Referenced by pd_update().
int getthrds | ( | pid_t | , |
struct thrdsinfo64 * | , | ||
int | , | ||
tid_t * | , | ||
int | |||
) |
Referenced by get_signaled_thread().
|
static |
Definition at line 665 of file aix-thread.c.
References PD_TID, and thread_info::ptid.
Referenced by sync_threadlists().
|
static |
Definition at line 650 of file aix-thread.c.
References PD_TID, and thread_info::ptid.
Referenced by sync_threadlists().
|
static |
Definition at line 870 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 1010 of file aix-thread.c.
References pd_disable(), and pd_enable().
Referenced by _initialize_aix_thread().
|
static |
Definition at line 635 of file aix-thread.c.
References pd_thread::pthid.
Referenced by sync_threadlists().
|
static |
Definition at line 918 of file aix-thread.c.
References arch64, pd_active, pd_callbacks, pd_session, pd_update(), pid, and status.
Referenced by pd_enable(), and aix_thread_target::wait().
|
static |
Definition at line 936 of file aix-thread.c.
References inferior_ptid, pd_active, pd_session, and pid_to_prc().
Referenced by aix_thread_target::mourn_inferior(), and pd_disable().
|
static |
Definition at line 992 of file aix-thread.c.
References aix_thread_ops, current_inferior(), pd_able, pd_active, pd_deactivate(), and inferior::unpush_target().
Referenced by aix_thread_target::detach(), and new_objfile().
|
static |
Definition at line 950 of file aix-thread.c.
References aix_thread_ops, arch64, create_thread_event_breakpoint(), current_inferior(), inferior_ptid, lookup_minimal_symbol(), bound_minimal_symbol::minsym, pd_able, pd_activate(), pd_brk_addr, pd_callbacks, 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 202 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 884 of file aix-thread.c.
References get_signaled_thread(), iter_tid(), iterate_over_threads(), pd_active, pd_session, 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 555 of file aix-thread.c.
References debug_aix_thread, gdb_printf(), gdb_stdlog, PDC_FAILURE, PDC_SUCCESS, and xmalloc().
|
static |
Definition at line 594 of file aix-thread.c.
References debug_aix_thread, gdb_printf(), gdb_stdlog, PDC_SUCCESS, and xfree().
|
static |
Definition at line 498 of file aix-thread.c.
References current_inferior(), debug_aix_thread, gdb_printf(), gdb_stdlog, pd_status2str(), PDC_FAILURE, PDC_SUCCESS, status, switch_to_thread(), and target_read_memory().
|
static |
Definition at line 376 of file aix-thread.c.
References arch64, debug_aix_thread, flags, gdb_printf(), gdb_stdlog, ppc_num_fprs, ppc_num_gprs, ptrace32(), and ptrace64aix().
|
static |
Definition at line 577 of file aix-thread.c.
References debug_aix_thread, gdb_printf(), gdb_stdlog, PDC_FAILURE, PDC_SUCCESS, and xrealloc().
|
static |
Definition at line 329 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 532 of file aix-thread.c.
References debug_aix_thread, gdb_printf(), gdb_stdlog, pd_status2str(), PDC_FAILURE, PDC_SUCCESS, status, and target_write_memory().
|
static |
Definition at line 448 of file aix-thread.c.
References arch64, debug_aix_thread, flags, gdb_printf(), gdb_stdlog, ptrace32(), and ptrace64aix().
|
static |
Definition at line 316 of file aix-thread.c.
References PD_TID.
Referenced by pd_deactivate(), and aix_thread_target::wait().
|
static |
Definition at line 678 of file aix-thread.c.
Referenced by gcmp(), and sync_threadlists().
|
static |
Definition at line 305 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 286 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 246 of file aix-thread.c.
References debug_aix_thread, gdb_printf(), and gdb_stdlog.
Referenced by ptrace32(), and ptrace64aix().
|
static |
Definition at line 1159 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 607 of file aix-thread.c.
Referenced by aix_thread_target::extra_thread_info().
|
static |
Definition at line 1595 of file aix-thread.c.
References reg_buffer::arch(), arch64, debug_aix_thread, fill_fprs(), fill_gprs32(), fill_gprs64(), fill_sprs32(), fill_sprs64(), gdb_printf(), gdb_stdlog, reg_buffer::get_register_status(), 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, ptrace32(), ptrace64aix(), reg_buffer::raw_collect(), and special_register_p().
Referenced by aix_thread_target::store_registers().
|
static |
Definition at line 1506 of file aix-thread.c.
References reg_buffer::arch(), arch64, debug_aix_thread, fill_fprs(), fill_sprs32(), fill_sprs64(), gdb_printf(), gdb_stdlog, gdbarch_pc_regnum(), reg_buffer::get_register_status(), pd_session, 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_gdbarch_tdep::ppc_ps_regnum, ppc_gdbarch_tdep::ppc_xer_regnum, reg_buffer::raw_collect(), and status.
Referenced by aix_thread_target::store_registers().
|
static |
Definition at line 1140 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 1118 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 1132 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 1200 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 1178 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 744 of file aix-thread.c.
References add_thread(), add_thread_with_info(), current_inferior(), delete_thread(), gcmp(), get_aix_thread_info(), giter_accum(), giter_count(), iterate_over_threads(), pcmp(), pd_session, 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, aix_thread_info::tid, pd_thread::tid, xfree(), and xrealloc().
Referenced by pd_update().
|
static |
Definition at line 145 of file aix-thread.c.
Referenced by pd_disable(), and pd_enable().
|
static |
Definition at line 106 of file aix-thread.c.
Referenced by aix_thread_target::info().
|
static |
Definition at line 163 of file aix-thread.c.
Referenced by fetch_regs_kernel_thread(), fetch_regs_user_thread(), pd_activate(), pd_enable(), pdc_read_regs(), pdc_write_regs(), aix_thread_target::resume(), store_regs_kernel_thread(), store_regs_user_thread(), and rs6000_nat_target::xfer_partial().
|
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 154 of file aix-thread.c.
Referenced by pd_disable(), and pd_enable().
|
static |
Definition at line 158 of file aix-thread.c.
Referenced by pd_activate(), pd_deactivate(), pd_disable(), pd_update(), and aix_thread_target::wait().
|
static |
Definition at line 150 of file aix-thread.c.
Referenced by pd_enable(), and aix_thread_target::wait().
|
static |
Definition at line 182 of file aix-thread.c.
Referenced by pd_activate(), and pd_enable().
|
static |
Definition at line 196 of file aix-thread.c.
Referenced by aix_thread_target::extra_thread_info(), fetch_regs_user_thread(), pd_activate(), pd_deactivate(), pd_update(), store_regs_user_thread(), and sync_threadlists().