36#include <asm/ptrace.h>
41#ifndef PTRACE_GET_THREAD_AREA
42#define PTRACE_GET_THREAD_AREA 25
52 void close ()
override;
73 int regno,
int store_p)
override;
105 error (_(
"Bogon register number %d."), regno);
115 regaddr = store? (CORE_ADDR) -1 :
CAUSE;
117 regaddr = store? (CORE_ADDR) -1 :
BADVADDR;
125 regaddr = store? (CORE_ADDR) -1 :
FPC_EIR;
135 regaddr = (CORE_ADDR) -1;
146 error (_(
"Bogon register number %d."), regno);
151 return (CORE_ADDR) -1;
181 regaddr = (CORE_ADDR) -1;
190 lwpid_t lwpid,
int idx,
void **base)
198 *base = (
void *) ((
char *)*base - idx);
275 if (regno == -1 || (!is_fp && !is_dsp))
286 perror_with_name (_(
"Couldn't get registers"));
293 if (regno == -1 || is_fp)
305 perror_with_name (_(
"Couldn't get FP registers"));
314 else if (regno == -1 && have_dsp)
362 if (regno == -1 || (!is_fp && !is_dsp))
367 perror_with_name (_(
"Couldn't get registers"));
372 perror_with_name (_(
"Couldn't set registers"));
375 if (regno == -1 || is_fp)
381 perror_with_name (_(
"Couldn't get FP registers"));
387 perror_with_name (_(
"Couldn't set FP registers"));
392 else if (regno == -1 && have_dsp)
446 int regno,
int store_p)
457 static int have_dsp = -1;
478 perror_with_name (_(
"Couldn't check DSP support"));
485 if (_MIPS_SIM == _ABIO32)
511 int len,
enum target_hw_bp_type
type)
518 " (addr=%s, len=%d, type=%s)",
520 type == hw_write ?
"data-write"
521 : (
type == hw_read ?
"data-read"
522 : (
type == hw_access ?
"data-read/write"
523 : (
type == hw_execute ?
"instruction-execute"
545 uint32_t wanted_mask, irw_mask;
572 if ((irw_mask & wanted_mask) == wanted_mask)
575 return (cnt == 0) ? 1 : 0;
642 int tid = lp->ptid.lwp ();
644 perror_with_name (_(
"Couldn't write debug register"));
655 long tid = lp->
ptid.lwp ();
663 perror_with_name (_(
"Couldn't write debug register"));
671 enum target_hw_bp_type
type,
699 new_watch->
addr = addr;
700 new_watch->
len = len;
702 new_watch->
next = NULL;
723 enum target_hw_bp_type
type,
793 &show_debug_regs, _(
"\
794Set whether to show variables that mirror the mips debug registers."), _(
"\
795Show whether to show variables that mirror the mips debug registers."), _(
"\
796Use \"on\" to enable, \"off\" to disable.\n\
797If enabled, the debug registers values are shown when GDB inserts\n\
798or removes a hardware breakpoint or watchpoint, and when the inferior\n\
799triggers a breakpoint or watchpoint."),
struct gdbarch * target_gdbarch(void)
void fetch_registers(struct regcache *, int) override
void store_registers(struct regcache *, int) override
int region_ok_for_hw_watchpoint(CORE_ADDR, int) override
void store_registers(struct regcache *, int) override
int can_use_hw_breakpoint(enum bptype, int, int) override
bool stopped_data_address(CORE_ADDR *) override
int remove_watchpoint(CORE_ADDR, int, enum target_hw_bp_type, struct expression *) override
bool stopped_by_watchpoint() override
void low_new_thread(struct lwp_info *lp) override
const struct target_desc * read_description() override
void mips64_regsets_store_registers(struct regcache *regcache, int regno)
void fetch_registers(struct regcache *, int) override
int insert_watchpoint(CORE_ADDR, int, enum target_hw_bp_type, struct expression *) override
void mips64_regsets_fetch_registers(struct regcache *regcache, int regno)
CORE_ADDR register_u_offset(struct gdbarch *gdbarch, int regno, int store_p) override
void raw_supply_zeroed(int regnum)
struct cmd_list_element * maintenance_show_cmdlist
struct cmd_list_element * maintenance_set_cmdlist
set_show_commands add_setshow_boolean_cmd(const char *name, enum command_class theclass, bool *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_func_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
#define ptrace(request, pid, addr, data)
int gdbarch_num_regs(struct gdbarch *gdbarch)
int gdbarch_fp0_regnum(struct gdbarch *gdbarch)
GDB_FPREGSET_T gdb_fpregset_t
GDB_GREGSET_T gdb_gregset_t
void add_inf_child_target(inf_child_target *target)
pid_t get_ptrace_pid(ptid_t ptid)
lwp_info_range all_lwps()
struct linux_nat_target * linux_target
const struct target_desc * tdesc_mips_dsp_linux
#define PTRACE_GET_THREAD_AREA
static mips_linux_nat_target the_mips_linux_nat_target
void supply_gregset(struct regcache *regcache, const gdb_gregset_t *gregsetp)
static CORE_ADDR mips_linux_register_addr(struct gdbarch *gdbarch, int regno, int store)
void fill_gregset(const struct regcache *regcache, gdb_gregset_t *gregsetp, int regno)
static struct mips_watchpoint * current_watches
void _initialize_mips_linux_nat()
void supply_fpregset(struct regcache *regcache, const gdb_fpregset_t *fpregsetp)
ps_err_e ps_get_thread_area(struct ps_prochandle *ph, lwpid_t lwpid, int idx, void **base)
static int watch_readback_valid
static int write_watchpoint_regs(void)
static struct pt_watch_regs watch_readback
static struct pt_watch_regs watch_mirror
void fill_fpregset(const struct regcache *regcache, gdb_fpregset_t *fpregsetp, int regno)
static void mips_show_dr(const char *func, CORE_ADDR addr, int len, enum target_hw_bp_type type)
static CORE_ADDR mips64_linux_register_addr(struct gdbarch *gdbarch, int regno, int store)
static int have_ptrace_regsets
void mips_fill_gregset(const struct regcache *regcache, mips_elf_gregset_t *gregsetp, int regno)
void mips_supply_gregset(struct regcache *regcache, const mips_elf_gregset_t *gregsetp)
int mips_linux_restart_reg_p(struct gdbarch *gdbarch)
void mips64_fill_gregset(const struct regcache *regcache, mips64_elf_gregset_t *gregsetp, int regno)
void mips64_fill_fpregset(const struct regcache *regcache, mips64_elf_fpregset_t *fpregsetp, int regno)
void mips64_supply_fpregset(struct regcache *regcache, const mips64_elf_fpregset_t *fpregsetp)
void mips64_supply_gregset(struct regcache *regcache, const mips64_elf_gregset_t *gregsetp)
mips64_elf_greg_t mips64_elf_gregset_t[MIPS64_ELF_NGREG]
mips_elf_greg_t mips_elf_gregset_t[ELF_NGREG]
mips64_elf_fpreg_t mips64_elf_fpregset_t[MIPS64_ELF_NFPREG]
CORE_ADDR mips_linux_watch_get_watchlo(struct pt_watch_regs *regs, int n)
void mips_linux_watch_set_watchlo(struct pt_watch_regs *regs, int n, CORE_ADDR value)
uint32_t mips_linux_watch_get_irw_mask(struct pt_watch_regs *regs, int n)
uint32_t mips_linux_watch_get_num_valid(struct pt_watch_regs *regs)
uint32_t mips_linux_watch_type_to_irw(enum target_hw_bp_type type)
int mips_linux_watch_try_one_watch(struct pt_watch_regs *regs, CORE_ADDR addr, int len, uint32_t irw)
void mips_linux_watch_populate_regs(struct mips_watchpoint *current_watches, struct pt_watch_regs *regs)
int mips_linux_read_watch_registers(long lwpid, struct pt_watch_regs *watch_readback, int *watch_readback_valid, int force)
uint32_t mips_linux_watch_get_watchhi(struct pt_watch_regs *regs, int n)
#define MAX_DEBUG_REGISTER
#define PTRACE_SET_WATCH_REGS
const struct target_desc * tdesc_mips_linux
const struct mips_regnum * mips_regnum(struct gdbarch *gdbarch)
unsigned int mips_abi_regsize(struct gdbarch *gdbarch)
int mips_isa_regsize(struct gdbarch *gdbarch)
const struct target_desc * tdesc_mips64_dsp_linux
const struct target_desc * tdesc_mips64_linux
int register_size(struct gdbarch *gdbarch, int regnum)
void(* func)(remote_target *remote, char *)
int fp_implementation_revision
enum target_hw_bp_type type
struct mips_watchpoint * next
const char * paddress(struct gdbarch *gdbarch, CORE_ADDR addr)
void gdb_printf(struct ui_file *stream, const char *format,...)
void gdb_puts(const char *linebuffer, struct ui_file *stream)