19 #include <sys/ptrace.h>
36 _(
"Unrecognized watch register style"));
54 _(
"Unrecognized watch register style"));
71 _(
"Unrecognized watch register style"));
89 _(
"Unrecognized watch register style"));
112 _(
"Unrecognized watch register style"));
130 _(
"Unrecognized watch register style"));
151 _(
"Unrecognized watch register style"));
163 int *watch_readback_valid,
int force)
165 if (force || *watch_readback_valid == 0)
169 *watch_readback_valid = -1;
172 switch (watch_readback->
style)
177 *watch_readback_valid = -1;
184 *watch_readback_valid = -1;
189 *watch_readback_valid = -1;
193 *watch_readback_valid = 1;
195 return (*watch_readback_valid == 1) ? 1 : 0;
223 while (f && f < mask)
239 CORE_ADDR base_addr, last_byte, break_addr, segment_len;
248 last_byte = addr + len - 1;
250 base_addr = addr & ~mask_bits;
256 if (t_low != 0 && irw == ((uint32_t) t_low & irw))
260 if (addr >= t_low && last_byte <= (t_low + t_hi))
286 if (free_watches > 1)
294 if (t_low == 0 && irw == (t_hi & irw))
297 break_addr = t_low + t_hi + 1;
298 if (break_addr >= addr + len)
301 segment_len = break_addr - addr;
302 mask_bits =
fill_mask (addr ^ (addr + segment_len - 1));
304 (addr & ~mask_bits) | irw);
307 if (break_addr >= addr + len)
312 len = addr + len - break_addr;
uint16_t watchhi[MAX_DEBUG_REGISTER]
struct mips_watchpoint * next
CORE_ADDR mips_linux_watch_get_watchlo(struct pt_watch_regs *regs, int n)
void internal_error(const char *file, int line, const char *fmt,...)
int mips_linux_watch_try_one_watch(struct pt_watch_regs *regs, CORE_ADDR addr, int len, uint32_t irw)
struct mips32_watch_regs mips32
void mips_linux_watch_set_watchhi(struct pt_watch_regs *regs, int n, uint16_t value)
uint32_t mips_linux_watch_get_irw_mask(struct pt_watch_regs *regs, int n)
static CORE_ADDR fill_mask(CORE_ADDR mask)
enum pt_watch_style style
struct mips64_watch_regs mips64
static uint32_t get_reg_mask(struct pt_watch_regs *regs, int n)
int mips_linux_read_watch_registers(long lwpid, struct pt_watch_regs *watch_readback, int *watch_readback_valid, int force)
uint64_t watchlo[MAX_DEBUG_REGISTER]
uint32_t mips_linux_watch_get_watchhi(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_type_to_irw(int type)
#define PTRACE_GET_WATCH_REGS
uint16_t watchhi[MAX_DEBUG_REGISTER]
void mips_linux_watch_populate_regs(struct mips_watchpoint *current_watches, struct pt_watch_regs *regs)
uint32_t mips_linux_watch_get_num_valid(struct pt_watch_regs *regs)
uint32_t watchlo[MAX_DEBUG_REGISTER]
uint16_t watch_masks[MAX_DEBUG_REGISTER]
uint16_t watch_masks[MAX_DEBUG_REGISTER]