35 #include <sys/ptrace.h>
36 #include <asm/ptrace.h>
45 #ifndef PTRACE_GET_THREAD_AREA
46 #define PTRACE_GET_THREAD_AREA 25
76 error (
_(
"Bogon register number %d."), regno);
117 error (
_(
"Bogon register number %d."), regno);
156 lwpid_t lwpid,
int idx,
void **base)
164 *base = (
void *) ((
char *)*base - idx);
228 else if (regno ==
mips_regnum (gdbarch)->fp_control_status)
230 else if (regno ==
mips_regnum (gdbarch)->fp_implementation_revision)
251 if (regno == -1 || (!is_fp && !is_dsp))
269 if (regno == -1 || is_fp)
290 else if (regno == -1 && have_dsp)
316 else if (regno ==
mips_regnum (gdbarch)->fp_control_status)
318 else if (regno ==
mips_regnum (gdbarch)->fp_implementation_revision)
339 if (regno == -1 || (!is_fp && !is_dsp))
352 if (regno == -1 || is_fp)
369 else if (regno == -1 && have_dsp)
428 static int have_dsp = -1;
456 if (_MIPS_SIM == _ABIO32)
491 : (type ==
hw_read ?
"data-read"
512 int type,
int cnt,
int ot)
515 uint32_t wanted_mask, irw_mask;
542 if ((irw_mask & wanted_mask) == wanted_mask)
545 return (cnt == 0) ? 1 : 0;
679 new_watch->
next = NULL;
715 if (w->
addr == addr && w->
len == len && w->
type == type)
760 current_watches = NULL;
775 Set whether to show variables that mirror the mips debug registers."),
_(
"\
776 Show whether to show variables that mirror the mips debug registers."),
_(
"\
777 Use \"on\" to enable, \"off\" to disable.\n\
778 If enabled, the debug registers values are shown when GDB inserts\n\
779 or removes a hardware breakpoint or watchpoint, and when the inferior\n\
780 triggers a breakpoint or watchpoint."),
struct gdbarch * target_gdbarch(void)
static int mips_linux_insert_watchpoint(struct target_ops *self, CORE_ADDR addr, int len, int type, struct expression *cond)
const struct target_desc *(* to_read_description)(struct target_ops *ops) TARGET_DEFAULT_RETURN(NULL)
static void mips64_linux_regsets_fetch_registers(struct target_ops *ops, struct regcache *regcache, int regno)
void _initialize_mips_linux_nat(void)
struct gdbarch * get_regcache_arch(const struct regcache *regcache)
void linux_nat_set_new_thread(struct target_ops *t, void(*new_thread)(struct lwp_info *))
struct mips_watchpoint * next
struct target_desc * tdesc_mips_linux
static int mips_linux_stopped_by_watchpoint(struct target_ops *ops)
CORE_ADDR mips_linux_watch_get_watchlo(struct pt_watch_regs *regs, int n)
static CORE_ADDR mips64_linux_register_addr(struct gdbarch *gdbarch, int regno, int store)
int mips_isa_regsize(struct gdbarch *gdbarch)
static void(* super_store_registers)(struct target_ops *, struct regcache *, int)
int mips_linux_watch_try_one_watch(struct pt_watch_regs *regs, CORE_ADDR addr, int len, uint32_t irw)
void(* to_close)(struct target_ops *)
static void mips_linux_close(struct target_ops *self)
void fill_gregset(const struct regcache *regcache, gdb_gregset_t *gregsetp, int regno)
void mips64_fill_gregset(const struct regcache *regcache, mips64_elf_gregset_t *gregsetp, int regno)
int(* to_region_ok_for_hw_watchpoint)(struct target_ops *, CORE_ADDR, int) TARGET_DEFAULT_FUNC(default_region_ok_for_hw_watchpoint)
int gdbarch_num_regs(struct gdbarch *gdbarch)
static int mips_linux_remove_watchpoint(struct target_ops *self, CORE_ADDR addr, int len, int type, struct expression *cond)
const struct mips_regnum * mips_regnum(struct gdbarch *gdbarch)
static struct mips_watchpoint * current_watches
#define PTRACE_GET_THREAD_AREA
struct cmd_list_element * maintenance_set_cmdlist
static void initialize_tdesc_mips_linux(void)
struct target_desc * tdesc_mips64_dsp_linux
const char * paddress(struct gdbarch *gdbarch, CORE_ADDR addr)
unsigned int mips_abi_regsize(struct gdbarch *gdbarch)
static const struct target_desc * mips_linux_read_description(struct target_ops *ops)
int(* to_insert_watchpoint)(struct target_ops *, CORE_ADDR, int, int, struct expression *) TARGET_DEFAULT_RETURN(-1)
static void mips64_linux_store_registers(struct target_ops *ops, struct regcache *regcache, int regnum)
void mips_fill_gregset(const struct regcache *regcache, mips_elf_gregset_t *gregsetp, int regno)
static int mips_linux_stopped_data_address(struct target_ops *t, CORE_ADDR *paddr)
static int have_ptrace_regsets
mips64_elf_greg_t mips64_elf_gregset_t[MIPS64_ELF_NGREG]
uint32_t mips_linux_watch_get_irw_mask(struct pt_watch_regs *regs, int n)
struct target_desc * tdesc_mips_dsp_linux
GDB_GREGSET_T gdb_gregset_t
int(* to_remove_watchpoint)(struct target_ops *, CORE_ADDR, int, int, struct expression *) TARGET_DEFAULT_RETURN(-1)
GDB_FPREGSET_T gdb_fpregset_t
static void initialize_tdesc_mips64_dsp_linux(void)
static int mips_linux_can_use_hw_breakpoint(struct target_ops *self, int type, int cnt, int ot)
static CORE_ADDR mips_linux_register_u_offset(struct gdbarch *gdbarch, int regno, int store_p)
int mips_linux_restart_reg_p(struct gdbarch *gdbarch)
static int watch_readback_valid
static void initialize_tdesc_mips_dsp_linux(void)
void supply_gregset(struct regcache *regcache, const gdb_gregset_t *gregsetp)
void mips64_supply_gregset(struct regcache *regcache, const mips64_elf_gregset_t *gregsetp)
void linux_nat_add_target(struct target_ops *t)
static void mips_linux_new_thread(struct lwp_info *lp)
static int mips_linux_region_ok_for_hw_watchpoint(struct target_ops *self, CORE_ADDR addr, int len)
int fp_implementation_revision
ps_err_e ps_get_thread_area(const struct ps_prochandle *ph, lwpid_t lwpid, int idx, void **base)
void printf_unfiltered(const char *format,...)
int mips_linux_read_watch_registers(long lwpid, struct pt_watch_regs *watch_readback, int *watch_readback_valid, int force)
void mips64_fill_fpregset(const struct regcache *regcache, mips64_elf_fpregset_t *fpregsetp, int regno)
int ptid_get_pid(ptid_t ptid)
static void mips_show_dr(const char *func, CORE_ADDR addr, int len, enum target_hw_bp_type type)
static int write_watchpoint_regs(void)
static struct pt_watch_regs watch_mirror
const char const char int
static void initialize_tdesc_mips64_linux(void)
void(* to_fetch_registers)(struct target_ops *, struct regcache *, int) TARGET_DEFAULT_IGNORE()
void puts_unfiltered(const char *string)
struct target_desc * tdesc_mips64_linux
void void void void void void void void void perror_with_name(const char *string) ATTRIBUTE_NORETURN
void fill_fpregset(const struct regcache *regcache, gdb_fpregset_t *fpregsetp, int regno)
int(* to_can_use_hw_breakpoint)(struct target_ops *, int, int, int) TARGET_DEFAULT_RETURN(0)
int gdbarch_fp0_regnum(struct gdbarch *gdbarch)
static CORE_ADDR mips_linux_register_addr(struct gdbarch *gdbarch, int regno, int store)
uint32_t mips_linux_watch_get_watchhi(struct pt_watch_regs *regs, int n)
#define MAX_DEBUG_REGISTER
mips_elf_fpreg_t mips_elf_fpregset_t[ELF_NFPREG]
void mips_supply_fpregset(struct regcache *regcache, const mips_elf_fpregset_t *fpregsetp)
static void mips64_linux_regsets_store_registers(struct target_ops *ops, struct regcache *regcache, int regno)
#define PTRACE_SET_WATCH_REGS
void mips_linux_watch_set_watchlo(struct pt_watch_regs *regs, int n, CORE_ADDR value)
int(* to_stopped_by_watchpoint)(struct target_ops *) TARGET_DEFAULT_RETURN(0)
uint32_t mips_linux_watch_type_to_irw(int type)
void mips_supply_gregset(struct regcache *regcache, const mips_elf_gregset_t *gregsetp)
static void(* super_fetch_registers)(struct target_ops *, struct regcache *, int)
void mips_linux_watch_populate_regs(struct mips_watchpoint *current_watches, struct pt_watch_regs *regs)
void mips64_supply_fpregset(struct regcache *regcache, const mips64_elf_fpregset_t *fpregsetp)
long ptid_get_lwp(ptid_t ptid)
static void(* super_close)(struct target_ops *)
uint32_t mips_linux_watch_get_num_valid(struct pt_watch_regs *regs)
void mips_fill_fpregset(const struct regcache *regcache, mips_elf_fpregset_t *fpregsetp, int regno)
mips_elf_greg_t mips_elf_gregset_t[ELF_NGREG]
int(* to_stopped_data_address)(struct target_ops *, CORE_ADDR *) TARGET_DEFAULT_RETURN(0)
void(* to_store_registers)(struct target_ops *, struct regcache *, int) TARGET_DEFAULT_NORETURN(noprocess())
mips64_elf_fpreg_t mips64_elf_fpregset_t[MIPS64_ELF_NFPREG]
struct cmd_list_element * maintenance_show_cmdlist
void error(const char *fmt,...)
static struct pt_watch_regs watch_readback
void supply_fpregset(struct regcache *regcache, const gdb_fpregset_t *fpregsetp)
void add_setshow_boolean_cmd(const char *name, enum command_class theclass, int *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
static void mips64_linux_fetch_registers(struct target_ops *ops, struct regcache *regcache, int regnum)
struct target_ops * linux_trad_target(CORE_ADDR(*register_u_offset)(struct gdbarch *, int, int))
const ULONGEST const LONGEST len