45 #define tdesc_mips_linux tdesc_mips64_linux 46 #define tdesc_mips_dsp_linux tdesc_mips64_dsp_linux 49 #ifndef PTRACE_GET_THREAD_AREA 50 #define PTRACE_GET_THREAD_AREA 25 57 #define mips_num_regs 73 58 #define mips_dsp_num_regs 80 60 #include <asm/ptrace.h> 64 #define DSP_CONTROL 77 78 #define mips_base_regs \ 79 -1, 1, 2, 3, 4, 5, 6, 7, \ 80 8, 9, 10, 11, 12, 13, 14, 15, \ 81 16, 17, 18, 19, 20, 21, 22, 23, \ 82 24, 25, 26, 27, 28, 29, 30, 31, \ 84 -1, MMLO, MMHI, BADVADDR, CAUSE, PC, \ 86 FPR_BASE, FPR_BASE + 1, FPR_BASE + 2, FPR_BASE + 3, \ 87 FPR_BASE + 4, FPR_BASE + 5, FPR_BASE + 6, FPR_BASE + 7, \ 88 FPR_BASE + 8, FPR_BASE + 9, FPR_BASE + 10, FPR_BASE + 11, \ 89 FPR_BASE + 12, FPR_BASE + 13, FPR_BASE + 14, FPR_BASE + 15, \ 90 FPR_BASE + 16, FPR_BASE + 17, FPR_BASE + 18, FPR_BASE + 19, \ 91 FPR_BASE + 20, FPR_BASE + 21, FPR_BASE + 22, FPR_BASE + 23, \ 92 FPR_BASE + 24, FPR_BASE + 25, FPR_BASE + 26, FPR_BASE + 27, \ 93 FPR_BASE + 28, FPR_BASE + 29, FPR_BASE + 30, FPR_BASE + 31, \ 96 #define mips_dsp_regs \ 97 DSP_BASE, DSP_BASE + 1, DSP_BASE + 2, DSP_BASE + 3, \ 98 DSP_BASE + 4, DSP_BASE + 5, \ 116 0xfe, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x80
267 #define mips_breakpoint_len 4 363 new_watch->
type = watch_type;
364 new_watch->
next = NULL;
632 if (last_byte >= t_low &&
addr <= t_low + t_hi)
645 lwpid_t lwpid,
int idx,
void **base)
653 *base = (
void *) ((
char *)*base - idx);
658 #ifdef HAVE_PTRACE_GETREGS 674 reg->
reg64 = tmp_reg.reg32;
686 if (__BYTE_ORDER == __BIG_ENDIAN && !use_64bit)
694 int use_64bit,
int regno,
unsigned char *
buf)
699 mips_collect_register (
regcache, use_64bit, regno, &tmp_reg);
700 reg32 = tmp_reg.reg64;
706 int use_64bit,
int regno,
const unsigned char *
buf)
712 tmp_reg.reg64 =
reg32;
713 mips_supply_register (
regcache, use_64bit, regno, &tmp_reg);
725 for (i = 1; i < 32; i++)
726 mips_collect_register (
regcache, use_64bit, i, regset + i);
728 mips_collect_register (
regcache, use_64bit,
730 mips_collect_register (
regcache, use_64bit,
732 mips_collect_register (
regcache, use_64bit,
734 mips_collect_register (
regcache, use_64bit,
736 mips_collect_register (
regcache, use_64bit,
738 mips_collect_register (
regcache, use_64bit,
741 mips_collect_register (
regcache, use_64bit,
753 for (i = 0; i < 32; i++)
754 mips_supply_register (
regcache, use_64bit, i, regset + i);
756 mips_supply_register (
regcache, use_64bit,
758 mips_supply_register (
regcache, use_64bit,
760 mips_supply_register (
regcache, use_64bit,
762 mips_supply_register (
regcache, use_64bit,
764 mips_supply_register (
regcache, use_64bit,
766 mips_supply_register (
regcache, use_64bit,
769 mips_supply_register (
regcache, use_64bit,
777 int i, use_64bit, first_fp, big_endian;
781 big_endian = (__BYTE_ORDER == __BIG_ENDIAN);
784 for (i = 0; i < 32; i++)
789 regset[i & ~1].
buf + 4 * (big_endian != (i & 1)));
791 mips_collect_register_32bit (
regcache, use_64bit,
793 mips_collect_register_32bit (
regcache, use_64bit,
802 int i, use_64bit, first_fp, big_endian;
806 big_endian = (__BYTE_ORDER == __BIG_ENDIAN);
809 for (i = 0; i < 32; i++)
814 regset[i & ~1].
buf + 4 * (big_endian != (i & 1)));
816 mips_supply_register_32bit (
regcache, use_64bit,
819 mips_supply_register_32bit (
regcache, use_64bit,
826 #ifdef HAVE_PTRACE_GETREGS 827 { PTRACE_GETREGS, PTRACE_SETREGS, 0, 38 * 8, GENERAL_REGS,
828 mips_fill_gregset, mips_store_gregset },
829 { PTRACE_GETFPREGS, PTRACE_SETFPREGS, 0, 33 * 8, FP_REGS,
830 mips_fill_fpregset, mips_store_fpregset },
const struct target_desc * tdesc
struct arch_lwp_info * arch_private
enum target_hw_bp_type raw_bkpt_type_to_target_hw_bp_type(enum raw_bkpt_type raw_type)
static void mips_linux_new_thread(struct lwp_info *lwp)
static struct regsets_info mips_regsets_info
struct thread_info * current_thread
void collect_register(struct regcache *regcache, int n, void *buf)
static void xfree(T *ptr)
#define mips_dsp_num_regs
struct usrregs_info * usrregs
const struct target_desc * tdesc_mips_dsp_linux
#define mips_breakpoint_len
void supply_register_by_name(struct regcache *regcache, const char *name, const void *buf)
static int mips_cannot_fetch_register(int regno)
static void mips_linux_prepare_to_resume(struct lwp_info *lwp)
int ptid_get_pid(const ptid_t &ptid)
enum target_hw_bp_type type
int watch_registers_changed
struct mips_watchpoint * next
static long lwpid_of(const thread_info *thread)
CORE_ADDR mips_linux_watch_get_watchlo(struct pt_watch_regs *regs, int n)
static ptid_t ptid_of(const thread_info *thread)
static struct usrregs_info mips_usrregs_info
int mips_linux_watch_try_one_watch(struct pt_watch_regs *regs, CORE_ADDR addr, int len, uint32_t irw)
void init_registers_mips64_linux(void)
void init_registers_mips64_dsp_linux(void)
const struct regs_info *(* regs_info)(void)
uint32_t mips_linux_watch_type_to_irw(enum target_hw_bp_type type)
static void for_each_thread(Func func)
static struct usrregs_info * get_usrregs_info(void)
#define get_thread_lwp(thr)
struct target_ops * the_target
struct pt_watch_regs watch_mirror
const struct target_desc * tdesc
const struct target_desc * tdesc_mips64_dsp_linux
struct arch_process_info * arch_private
ps_err_e ps_get_thread_area(struct ps_prochandle *ph, lwpid_t lwpid, int idx, void **base)
void collect_register_by_name(struct regcache *regcache, const char *name, void *buf)
struct mips_watchpoint * current_watches
struct linux_target_ops the_low_target
process_info * find_process_pid(int pid)
static void mips_linux_delete_process(struct arch_process_info *info)
static const struct regs_info * mips_regs_info(void)
static const struct target_desc * mips_read_description(void)
static struct arch_process_info * mips_linux_new_process(void)
static struct regs_info dsp_regs_info
static int mips_supports_z_point_type(char z_type)
#define get_lwp_thread(lwp)
int register_size(const struct target_desc *tdesc, int n)
static void mips_linux_delete_thread(struct arch_lwp_info *arch_lwp)
static void mips_arch_setup(void)
static int mips_insert_point(enum raw_bkpt_type type, CORE_ADDR addr, int len, struct raw_breakpoint *bp)
struct process_info * current_process(void)
static int mips_cannot_store_register(int regno)
struct process_info_private * priv
int mips_linux_read_watch_registers(long lwpid, struct pt_watch_regs *watch_readback, int *watch_readback_valid, int force)
static const unsigned int mips_breakpoint
long ptid_get_lwp(const ptid_t &ptid)
static int mips_remove_point(enum raw_bkpt_type type, CORE_ADDR addr, int len, struct raw_breakpoint *bp)
static void update_watch_registers_callback(thread_info *thread)
static struct usrregs_info mips_dsp_usrregs_info
const struct target_desc * tdesc_mips_linux
static int mips_breakpoint_at(CORE_ADDR where)
int find_regno(const struct target_desc *tdesc, const char *name)
static unsigned char mips_dsp_regset_bitmap[(mips_dsp_num_regs+7)/8]
uint32_t mips_linux_watch_get_watchhi(struct pt_watch_regs *regs, int n)
static void mips_add_watchpoint(struct arch_process_info *priv, CORE_ADDR addr, int len, enum target_hw_bp_type watch_type)
#define MAX_DEBUG_REGISTER
#define PTRACE_SET_WATCH_REGS
int(* read_memory)(CORE_ADDR memaddr, unsigned char *myaddr, int len)
#define Z_PACKET_ACCESS_WP
void perror_with_name(const char *string)
static void mips_linux_new_fork(struct process_info *parent, struct process_info *child)
void init_registers_mips_linux(void)
void mips_linux_watch_populate_regs(struct mips_watchpoint *current_watches, struct pt_watch_regs *regs)
static int mips_regmap[mips_num_regs]
struct pt_watch_regs watch_readback
static int mips_stopped_by_watchpoint(void)
void initialize_low_arch(void)
uint32_t mips_linux_watch_get_num_valid(struct pt_watch_regs *regs)
void linux_stop_lwp(struct lwp_info *lwp)
void supply_register(struct regcache *regcache, int n, const void *buf)
static int mips_dsp_regmap[mips_dsp_num_regs]
static const gdb_byte * mips_sw_breakpoint_from_kind(int kind, int *size)
static CORE_ADDR mips_stopped_data_address(void)
static struct regs_info regs_info
static void mips_set_pc(struct regcache *regcache, CORE_ADDR pc)
#define PTRACE_GET_THREAD_AREA
#define Z_PACKET_WRITE_WP
struct thread_info * thread
const struct target_desc * tdesc_mips64_linux
static CORE_ADDR mips_get_pc(struct regcache *regcache)
void init_registers_mips_dsp_linux(void)
static struct regset_info mips_regsets[]