21 #include <sys/ptrace.h>
28 #define cris_num_regs 49
30 #ifndef PTRACE_GET_THREAD_AREA
31 #define PTRACE_GET_THREAD_AREA 25
41 9*4, 10*4, 11*4, 12*4,
42 13*4, 14*4, 24*4, 15*4,
52 30*4, 31*4, 32*4, 33*4,
53 34*4, 35*4, 36*4, 37*4,
73 unsigned long newpc = pc;
78 #define cris_breakpoint_len 2
87 if (insn == cris_breakpoint)
114 int bp,
unsigned long start,
unsigned long end)
164 unsigned long bp_ctrl;
165 unsigned long start, end;
187 for (bp = 0; bp < 6; bp++)
192 if (!(bp_ctrl & (0x3 << (2 + (bp * 4)))))
206 bp_ctrl |= (1 << (2 + bp * 4));
211 bp_ctrl |= (2 << (2 + bp * 4));
219 end = addr + len - 1;
237 unsigned long bp_ctrl;
238 unsigned long start, end;
240 unsigned long bp_d_regs[12];
273 for (bp = 0; bp < 6; bp++)
275 if (bp_d_regs[bp * 2] == addr
276 && bp_d_regs[bp * 2 + 1] == (addr + len - 1)) {
278 int bitpos = 2 + bp * 4;
282 rw_bits = (bp_ctrl & (0x3 << bitpos)) >> bitpos;
303 bp_ctrl &= ~(3 << (2 + (bp * 4)));
323 return (((exs & 0xff00) >> 8) == 0xc);
340 lwpid_t lwpid,
int idx,
void **base)
348 *base = (
void *) ((
char *) *base - idx);
359 if (cris_regmap[i] != -1)
371 if (cris_regmap[i] != -1)
385 { 0, 0, 0, -1, -1, NULL, NULL }
402 static struct regs_info regs_info =
409 static const struct regs_info *
423 (
const unsigned char *) &cris_breakpoint,
440 initialize_regsets_info (&cris_regsets_info);
struct thread_info * current_thread
void collect_register(struct regcache *regcache, int n, void *buf)
void supply_register_by_name(struct regcache *regcache, const char *name, const void *buf)
const struct target_desc * tdesc_crisv32
static int cris_insert_point(enum raw_bkpt_type type, CORE_ADDR addr, int len, struct raw_breakpoint *bp)
static CORE_ADDR cris_get_pc(struct regcache *regcache)
struct target_ops * the_target
static void cris_write_data_breakpoint(struct regcache *regcache, int bp, unsigned long start, unsigned long end)
const struct target_desc * tdesc
static void cris_fill_gregset(struct regcache *regcache, void *buf)
static CORE_ADDR cris_stopped_data_address(void)
static const struct regs_info * cris_regs_info(void)
void collect_register_by_name(struct regcache *regcache, const char *name, void *buf)
static struct regsets_info cris_regsets_info
static int cris_remove_point(enum raw_bkpt_type type, CORE_ADDR addr, int len, struct raw_breakpoint *bp)
#define PTRACE_GET_THREAD_AREA
struct process_info * current_process(void)
static void cris_arch_setup(void)
static const unsigned short cris_breakpoint
static struct regs_info regs_info
void initialize_low_arch(void)
#define cris_breakpoint_len
static void cris_store_gregset(struct regcache *regcache, const void *buf)
static CORE_ADDR cris_reinsert_addr(void)
void init_registers_crisv32(void)
static struct regset_info cris_regsets[]
static struct usrregs_info cris_usrregs_info
static int cris_breakpoint_at(CORE_ADDR where)
int(* read_memory)(CORE_ADDR memaddr, unsigned char *myaddr, int len)
struct regcache * get_thread_regcache(struct thread_info *thread, int fetch)
#define Z_PACKET_ACCESS_WP
static int cris_stopped_by_watchpoint(void)
static int cris_supports_z_point_type(char z_type)
void debug_printf(const char *fmt,...)
void supply_register(struct regcache *regcache, int n, const void *buf)
ps_err_e ps_get_thread_area(const struct ps_prochandle *ph, lwpid_t lwpid, int idx, void **base)
#define Z_PACKET_WRITE_WP
static void cris_set_pc(struct regcache *regcache, CORE_ADDR pc)