exec: Change cpu_watchpoint_{insert,remove{,_by_ref,_all}} argument
Use CPUState. This lets us drop a few local env usages. Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
parent
d0e39c5d70
commit
75a34036d4
34
exec.c
34
exec.c
@ -33,6 +33,7 @@
|
|||||||
#include "hw/xen/xen.h"
|
#include "hw/xen/xen.h"
|
||||||
#include "qemu/timer.h"
|
#include "qemu/timer.h"
|
||||||
#include "qemu/config-file.h"
|
#include "qemu/config-file.h"
|
||||||
|
#include "qemu/error-report.h"
|
||||||
#include "exec/memory.h"
|
#include "exec/memory.h"
|
||||||
#include "sysemu/dma.h"
|
#include "sysemu/dma.h"
|
||||||
#include "exec/address-spaces.h"
|
#include "exec/address-spaces.h"
|
||||||
@ -527,30 +528,30 @@ static void breakpoint_invalidate(CPUState *cpu, target_ulong pc)
|
|||||||
#endif /* TARGET_HAS_ICE */
|
#endif /* TARGET_HAS_ICE */
|
||||||
|
|
||||||
#if defined(CONFIG_USER_ONLY)
|
#if defined(CONFIG_USER_ONLY)
|
||||||
void cpu_watchpoint_remove_all(CPUArchState *env, int mask)
|
void cpu_watchpoint_remove_all(CPUState *cpu, int mask)
|
||||||
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
int cpu_watchpoint_insert(CPUArchState *env, target_ulong addr, target_ulong len,
|
int cpu_watchpoint_insert(CPUState *cpu, vaddr addr, vaddr len,
|
||||||
int flags, CPUWatchpoint **watchpoint)
|
int flags, CPUWatchpoint **watchpoint)
|
||||||
{
|
{
|
||||||
return -ENOSYS;
|
return -ENOSYS;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
/* Add a watchpoint. */
|
/* Add a watchpoint. */
|
||||||
int cpu_watchpoint_insert(CPUArchState *env, target_ulong addr, target_ulong len,
|
int cpu_watchpoint_insert(CPUState *cpu, vaddr addr, vaddr len,
|
||||||
int flags, CPUWatchpoint **watchpoint)
|
int flags, CPUWatchpoint **watchpoint)
|
||||||
{
|
{
|
||||||
CPUState *cpu = ENV_GET_CPU(env);
|
CPUArchState *env = cpu->env_ptr;
|
||||||
target_ulong len_mask = ~(len - 1);
|
vaddr len_mask = ~(len - 1);
|
||||||
CPUWatchpoint *wp;
|
CPUWatchpoint *wp;
|
||||||
|
|
||||||
/* sanity checks: allow power-of-2 lengths, deny unaligned watchpoints */
|
/* sanity checks: allow power-of-2 lengths, deny unaligned watchpoints */
|
||||||
if ((len & (len - 1)) || (addr & ~len_mask) ||
|
if ((len & (len - 1)) || (addr & ~len_mask) ||
|
||||||
len == 0 || len > TARGET_PAGE_SIZE) {
|
len == 0 || len > TARGET_PAGE_SIZE) {
|
||||||
fprintf(stderr, "qemu: tried to set invalid watchpoint at "
|
error_report("tried to set invalid watchpoint at %"
|
||||||
TARGET_FMT_lx ", len=" TARGET_FMT_lu "\n", addr, len);
|
VADDR_PRIx ", len=%" VADDR_PRIu, addr, len);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
wp = g_malloc(sizeof(*wp));
|
wp = g_malloc(sizeof(*wp));
|
||||||
@ -574,17 +575,16 @@ int cpu_watchpoint_insert(CPUArchState *env, target_ulong addr, target_ulong len
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Remove a specific watchpoint. */
|
/* Remove a specific watchpoint. */
|
||||||
int cpu_watchpoint_remove(CPUArchState *env, target_ulong addr, target_ulong len,
|
int cpu_watchpoint_remove(CPUState *cpu, vaddr addr, vaddr len,
|
||||||
int flags)
|
int flags)
|
||||||
{
|
{
|
||||||
CPUState *cpu = ENV_GET_CPU(env);
|
vaddr len_mask = ~(len - 1);
|
||||||
target_ulong len_mask = ~(len - 1);
|
|
||||||
CPUWatchpoint *wp;
|
CPUWatchpoint *wp;
|
||||||
|
|
||||||
QTAILQ_FOREACH(wp, &cpu->watchpoints, entry) {
|
QTAILQ_FOREACH(wp, &cpu->watchpoints, entry) {
|
||||||
if (addr == wp->vaddr && len_mask == wp->len_mask
|
if (addr == wp->vaddr && len_mask == wp->len_mask
|
||||||
&& flags == (wp->flags & ~BP_WATCHPOINT_HIT)) {
|
&& flags == (wp->flags & ~BP_WATCHPOINT_HIT)) {
|
||||||
cpu_watchpoint_remove_by_ref(env, wp);
|
cpu_watchpoint_remove_by_ref(cpu, wp);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -592,9 +592,9 @@ int cpu_watchpoint_remove(CPUArchState *env, target_ulong addr, target_ulong len
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Remove a specific watchpoint by reference. */
|
/* Remove a specific watchpoint by reference. */
|
||||||
void cpu_watchpoint_remove_by_ref(CPUArchState *env, CPUWatchpoint *watchpoint)
|
void cpu_watchpoint_remove_by_ref(CPUState *cpu, CPUWatchpoint *watchpoint)
|
||||||
{
|
{
|
||||||
CPUState *cpu = ENV_GET_CPU(env);
|
CPUArchState *env = cpu->env_ptr;
|
||||||
|
|
||||||
QTAILQ_REMOVE(&cpu->watchpoints, watchpoint, entry);
|
QTAILQ_REMOVE(&cpu->watchpoints, watchpoint, entry);
|
||||||
|
|
||||||
@ -604,14 +604,14 @@ void cpu_watchpoint_remove_by_ref(CPUArchState *env, CPUWatchpoint *watchpoint)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Remove all matching watchpoints. */
|
/* Remove all matching watchpoints. */
|
||||||
void cpu_watchpoint_remove_all(CPUArchState *env, int mask)
|
void cpu_watchpoint_remove_all(CPUState *cpu, int mask)
|
||||||
{
|
{
|
||||||
CPUState *cpu = ENV_GET_CPU(env);
|
|
||||||
CPUWatchpoint *wp, *next;
|
CPUWatchpoint *wp, *next;
|
||||||
|
|
||||||
QTAILQ_FOREACH_SAFE(wp, &cpu->watchpoints, entry, next) {
|
QTAILQ_FOREACH_SAFE(wp, &cpu->watchpoints, entry, next) {
|
||||||
if (wp->flags & mask)
|
if (wp->flags & mask) {
|
||||||
cpu_watchpoint_remove_by_ref(env, wp);
|
cpu_watchpoint_remove_by_ref(cpu, wp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
17
gdbstub.c
17
gdbstub.c
@ -657,8 +657,7 @@ static int gdb_breakpoint_insert(target_ulong addr, target_ulong len, int type)
|
|||||||
case GDB_WATCHPOINT_READ:
|
case GDB_WATCHPOINT_READ:
|
||||||
case GDB_WATCHPOINT_ACCESS:
|
case GDB_WATCHPOINT_ACCESS:
|
||||||
CPU_FOREACH(cpu) {
|
CPU_FOREACH(cpu) {
|
||||||
env = cpu->env_ptr;
|
err = cpu_watchpoint_insert(cpu, addr, len, xlat_gdb_type[type],
|
||||||
err = cpu_watchpoint_insert(env, addr, len, xlat_gdb_type[type],
|
|
||||||
NULL);
|
NULL);
|
||||||
if (err)
|
if (err)
|
||||||
break;
|
break;
|
||||||
@ -695,8 +694,7 @@ static int gdb_breakpoint_remove(target_ulong addr, target_ulong len, int type)
|
|||||||
case GDB_WATCHPOINT_READ:
|
case GDB_WATCHPOINT_READ:
|
||||||
case GDB_WATCHPOINT_ACCESS:
|
case GDB_WATCHPOINT_ACCESS:
|
||||||
CPU_FOREACH(cpu) {
|
CPU_FOREACH(cpu) {
|
||||||
env = cpu->env_ptr;
|
err = cpu_watchpoint_remove(cpu, addr, len, xlat_gdb_type[type]);
|
||||||
err = cpu_watchpoint_remove(env, addr, len, xlat_gdb_type[type]);
|
|
||||||
if (err)
|
if (err)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -721,7 +719,7 @@ static void gdb_breakpoint_remove_all(void)
|
|||||||
env = cpu->env_ptr;
|
env = cpu->env_ptr;
|
||||||
cpu_breakpoint_remove_all(env, BP_GDB);
|
cpu_breakpoint_remove_all(env, BP_GDB);
|
||||||
#ifndef CONFIG_USER_ONLY
|
#ifndef CONFIG_USER_ONLY
|
||||||
cpu_watchpoint_remove_all(env, BP_GDB);
|
cpu_watchpoint_remove_all(cpu, BP_GDB);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1593,13 +1591,16 @@ int gdbserver_start(int port)
|
|||||||
/* Disable gdb stub for child processes. */
|
/* Disable gdb stub for child processes. */
|
||||||
void gdbserver_fork(CPUArchState *env)
|
void gdbserver_fork(CPUArchState *env)
|
||||||
{
|
{
|
||||||
|
CPUState *cpu = ENV_GET_CPU(env);
|
||||||
GDBState *s = gdbserver_state;
|
GDBState *s = gdbserver_state;
|
||||||
if (gdbserver_fd < 0 || s->fd < 0)
|
|
||||||
return;
|
if (gdbserver_fd < 0 || s->fd < 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
close(s->fd);
|
close(s->fd);
|
||||||
s->fd = -1;
|
s->fd = -1;
|
||||||
cpu_breakpoint_remove_all(env, BP_GDB);
|
cpu_breakpoint_remove_all(env, BP_GDB);
|
||||||
cpu_watchpoint_remove_all(env, BP_GDB);
|
cpu_watchpoint_remove_all(cpu, BP_GDB);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
static int gdb_chr_can_receive(void *opaque)
|
static int gdb_chr_can_receive(void *opaque)
|
||||||
|
@ -427,12 +427,6 @@ int cpu_breakpoint_insert(CPUArchState *env, target_ulong pc, int flags,
|
|||||||
int cpu_breakpoint_remove(CPUArchState *env, target_ulong pc, int flags);
|
int cpu_breakpoint_remove(CPUArchState *env, target_ulong pc, int flags);
|
||||||
void cpu_breakpoint_remove_by_ref(CPUArchState *env, CPUBreakpoint *breakpoint);
|
void cpu_breakpoint_remove_by_ref(CPUArchState *env, CPUBreakpoint *breakpoint);
|
||||||
void cpu_breakpoint_remove_all(CPUArchState *env, int mask);
|
void cpu_breakpoint_remove_all(CPUArchState *env, int mask);
|
||||||
int cpu_watchpoint_insert(CPUArchState *env, target_ulong addr, target_ulong len,
|
|
||||||
int flags, CPUWatchpoint **watchpoint);
|
|
||||||
int cpu_watchpoint_remove(CPUArchState *env, target_ulong addr,
|
|
||||||
target_ulong len, int flags);
|
|
||||||
void cpu_watchpoint_remove_by_ref(CPUArchState *env, CPUWatchpoint *watchpoint);
|
|
||||||
void cpu_watchpoint_remove_all(CPUArchState *env, int mask);
|
|
||||||
|
|
||||||
#if !defined(CONFIG_USER_ONLY)
|
#if !defined(CONFIG_USER_ONLY)
|
||||||
|
|
||||||
|
@ -595,6 +595,13 @@ void qemu_init_vcpu(CPUState *cpu);
|
|||||||
*/
|
*/
|
||||||
void cpu_single_step(CPUState *cpu, int enabled);
|
void cpu_single_step(CPUState *cpu, int enabled);
|
||||||
|
|
||||||
|
int cpu_watchpoint_insert(CPUState *cpu, vaddr addr, vaddr len,
|
||||||
|
int flags, CPUWatchpoint **watchpoint);
|
||||||
|
int cpu_watchpoint_remove(CPUState *cpu, vaddr addr,
|
||||||
|
vaddr len, int flags);
|
||||||
|
void cpu_watchpoint_remove_by_ref(CPUState *cpu, CPUWatchpoint *watchpoint);
|
||||||
|
void cpu_watchpoint_remove_all(CPUState *cpu, int mask);
|
||||||
|
|
||||||
#ifdef CONFIG_SOFTMMU
|
#ifdef CONFIG_SOFTMMU
|
||||||
extern const struct VMStateDescription vmstate_cpu_common;
|
extern const struct VMStateDescription vmstate_cpu_common;
|
||||||
#else
|
#else
|
||||||
|
@ -3437,13 +3437,14 @@ CPUArchState *cpu_copy(CPUArchState *env)
|
|||||||
{
|
{
|
||||||
CPUState *cpu = ENV_GET_CPU(env);
|
CPUState *cpu = ENV_GET_CPU(env);
|
||||||
CPUArchState *new_env = cpu_init(cpu_model);
|
CPUArchState *new_env = cpu_init(cpu_model);
|
||||||
|
CPUState *new_cpu = ENV_GET_CPU(new_env);
|
||||||
#if defined(TARGET_HAS_ICE)
|
#if defined(TARGET_HAS_ICE)
|
||||||
CPUBreakpoint *bp;
|
CPUBreakpoint *bp;
|
||||||
CPUWatchpoint *wp;
|
CPUWatchpoint *wp;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Reset non arch specific state */
|
/* Reset non arch specific state */
|
||||||
cpu_reset(ENV_GET_CPU(new_env));
|
cpu_reset(new_cpu);
|
||||||
|
|
||||||
memcpy(new_env, env, sizeof(CPUArchState));
|
memcpy(new_env, env, sizeof(CPUArchState));
|
||||||
|
|
||||||
@ -3457,7 +3458,7 @@ CPUArchState *cpu_copy(CPUArchState *env)
|
|||||||
cpu_breakpoint_insert(new_env, bp->pc, bp->flags, NULL);
|
cpu_breakpoint_insert(new_env, bp->pc, bp->flags, NULL);
|
||||||
}
|
}
|
||||||
QTAILQ_FOREACH(wp, &cpu->watchpoints, entry) {
|
QTAILQ_FOREACH(wp, &cpu->watchpoints, entry) {
|
||||||
cpu_watchpoint_insert(new_env, wp->vaddr, (~wp->len_mask) + 1,
|
cpu_watchpoint_insert(new_cpu, wp->vaddr, (~wp->len_mask) + 1,
|
||||||
wp->flags, NULL);
|
wp->flags, NULL);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -2474,7 +2474,7 @@ static void x86_cpu_reset(CPUState *s)
|
|||||||
env->dr[6] = DR6_FIXED_1;
|
env->dr[6] = DR6_FIXED_1;
|
||||||
env->dr[7] = DR7_FIXED_1;
|
env->dr[7] = DR7_FIXED_1;
|
||||||
cpu_breakpoint_remove_all(env, BP_CPU);
|
cpu_breakpoint_remove_all(env, BP_CPU);
|
||||||
cpu_watchpoint_remove_all(env, BP_CPU);
|
cpu_watchpoint_remove_all(s, BP_CPU);
|
||||||
|
|
||||||
env->tsc_adjust = 0;
|
env->tsc_adjust = 0;
|
||||||
env->tsc = 0;
|
env->tsc = 0;
|
||||||
|
@ -993,6 +993,7 @@ hwaddr x86_cpu_get_phys_page_debug(CPUState *cs, vaddr addr)
|
|||||||
|
|
||||||
void hw_breakpoint_insert(CPUX86State *env, int index)
|
void hw_breakpoint_insert(CPUX86State *env, int index)
|
||||||
{
|
{
|
||||||
|
CPUState *cs = CPU(x86_env_get_cpu(env));
|
||||||
int type = 0, err = 0;
|
int type = 0, err = 0;
|
||||||
|
|
||||||
switch (hw_breakpoint_type(env->dr[7], index)) {
|
switch (hw_breakpoint_type(env->dr[7], index)) {
|
||||||
@ -1014,7 +1015,7 @@ void hw_breakpoint_insert(CPUX86State *env, int index)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (type != 0) {
|
if (type != 0) {
|
||||||
err = cpu_watchpoint_insert(env, env->dr[index],
|
err = cpu_watchpoint_insert(cs, env->dr[index],
|
||||||
hw_breakpoint_len(env->dr[7], index),
|
hw_breakpoint_len(env->dr[7], index),
|
||||||
type, &env->cpu_watchpoint[index]);
|
type, &env->cpu_watchpoint[index]);
|
||||||
}
|
}
|
||||||
@ -1026,8 +1027,12 @@ void hw_breakpoint_insert(CPUX86State *env, int index)
|
|||||||
|
|
||||||
void hw_breakpoint_remove(CPUX86State *env, int index)
|
void hw_breakpoint_remove(CPUX86State *env, int index)
|
||||||
{
|
{
|
||||||
if (!env->cpu_breakpoint[index])
|
CPUState *cs;
|
||||||
|
|
||||||
|
if (!env->cpu_breakpoint[index]) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
cs = CPU(x86_env_get_cpu(env));
|
||||||
switch (hw_breakpoint_type(env->dr[7], index)) {
|
switch (hw_breakpoint_type(env->dr[7], index)) {
|
||||||
case DR7_TYPE_BP_INST:
|
case DR7_TYPE_BP_INST:
|
||||||
if (hw_breakpoint_enabled(env->dr[7], index)) {
|
if (hw_breakpoint_enabled(env->dr[7], index)) {
|
||||||
@ -1036,7 +1041,7 @@ void hw_breakpoint_remove(CPUX86State *env, int index)
|
|||||||
break;
|
break;
|
||||||
case DR7_TYPE_DATA_WR:
|
case DR7_TYPE_DATA_WR:
|
||||||
case DR7_TYPE_DATA_RW:
|
case DR7_TYPE_DATA_RW:
|
||||||
cpu_watchpoint_remove_by_ref(env, env->cpu_watchpoint[index]);
|
cpu_watchpoint_remove_by_ref(cs, env->cpu_watchpoint[index]);
|
||||||
break;
|
break;
|
||||||
case DR7_TYPE_IO_RW:
|
case DR7_TYPE_IO_RW:
|
||||||
/* No support for I/O watchpoints yet */
|
/* No support for I/O watchpoints yet */
|
||||||
|
@ -290,6 +290,7 @@ static void cpu_pre_save(void *opaque)
|
|||||||
static int cpu_post_load(void *opaque, int version_id)
|
static int cpu_post_load(void *opaque, int version_id)
|
||||||
{
|
{
|
||||||
X86CPU *cpu = opaque;
|
X86CPU *cpu = opaque;
|
||||||
|
CPUState *cs = CPU(cpu);
|
||||||
CPUX86State *env = &cpu->env;
|
CPUX86State *env = &cpu->env;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -320,7 +321,7 @@ static int cpu_post_load(void *opaque, int version_id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
cpu_breakpoint_remove_all(env, BP_CPU);
|
cpu_breakpoint_remove_all(env, BP_CPU);
|
||||||
cpu_watchpoint_remove_all(env, BP_CPU);
|
cpu_watchpoint_remove_all(cs, BP_CPU);
|
||||||
for (i = 0; i < DR7_MAX_BP; i++) {
|
for (i = 0; i < DR7_MAX_BP; i++) {
|
||||||
hw_breakpoint_insert(env, i);
|
hw_breakpoint_insert(env, i);
|
||||||
}
|
}
|
||||||
|
@ -69,6 +69,7 @@ void lm32_breakpoint_remove(CPULM32State *env, int idx)
|
|||||||
void lm32_watchpoint_insert(CPULM32State *env, int idx, target_ulong address,
|
void lm32_watchpoint_insert(CPULM32State *env, int idx, target_ulong address,
|
||||||
lm32_wp_t wp_type)
|
lm32_wp_t wp_type)
|
||||||
{
|
{
|
||||||
|
LM32CPU *cpu = lm32_env_get_cpu(env);
|
||||||
int flags = 0;
|
int flags = 0;
|
||||||
|
|
||||||
switch (wp_type) {
|
switch (wp_type) {
|
||||||
@ -87,18 +88,20 @@ void lm32_watchpoint_insert(CPULM32State *env, int idx, target_ulong address,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (flags != 0) {
|
if (flags != 0) {
|
||||||
cpu_watchpoint_insert(env, address, 1, flags,
|
cpu_watchpoint_insert(CPU(cpu), address, 1, flags,
|
||||||
&env->cpu_watchpoint[idx]);
|
&env->cpu_watchpoint[idx]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void lm32_watchpoint_remove(CPULM32State *env, int idx)
|
void lm32_watchpoint_remove(CPULM32State *env, int idx)
|
||||||
{
|
{
|
||||||
|
LM32CPU *cpu = lm32_env_get_cpu(env);
|
||||||
|
|
||||||
if (!env->cpu_watchpoint[idx]) {
|
if (!env->cpu_watchpoint[idx]) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
cpu_watchpoint_remove_by_ref(env, env->cpu_watchpoint[idx]);
|
cpu_watchpoint_remove_by_ref(CPU(cpu), env->cpu_watchpoint[idx]);
|
||||||
env->cpu_watchpoint[idx] = NULL;
|
env->cpu_watchpoint[idx] = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -790,11 +790,12 @@ void HELPER(wsr_ibreaka)(CPUXtensaState *env, uint32_t i, uint32_t v)
|
|||||||
static void set_dbreak(CPUXtensaState *env, unsigned i, uint32_t dbreaka,
|
static void set_dbreak(CPUXtensaState *env, unsigned i, uint32_t dbreaka,
|
||||||
uint32_t dbreakc)
|
uint32_t dbreakc)
|
||||||
{
|
{
|
||||||
|
CPUState *cs = CPU(xtensa_env_get_cpu(env));
|
||||||
int flags = BP_CPU | BP_STOP_BEFORE_ACCESS;
|
int flags = BP_CPU | BP_STOP_BEFORE_ACCESS;
|
||||||
uint32_t mask = dbreakc | ~DBREAKC_MASK;
|
uint32_t mask = dbreakc | ~DBREAKC_MASK;
|
||||||
|
|
||||||
if (env->cpu_watchpoint[i]) {
|
if (env->cpu_watchpoint[i]) {
|
||||||
cpu_watchpoint_remove_by_ref(env, env->cpu_watchpoint[i]);
|
cpu_watchpoint_remove_by_ref(cs, env->cpu_watchpoint[i]);
|
||||||
}
|
}
|
||||||
if (dbreakc & DBREAKC_SB) {
|
if (dbreakc & DBREAKC_SB) {
|
||||||
flags |= BP_MEM_WRITE;
|
flags |= BP_MEM_WRITE;
|
||||||
@ -808,7 +809,7 @@ static void set_dbreak(CPUXtensaState *env, unsigned i, uint32_t dbreaka,
|
|||||||
/* cut mask after the first zero bit */
|
/* cut mask after the first zero bit */
|
||||||
mask = 0xffffffff << (32 - clo32(mask));
|
mask = 0xffffffff << (32 - clo32(mask));
|
||||||
}
|
}
|
||||||
if (cpu_watchpoint_insert(env, dbreaka & mask, ~mask + 1,
|
if (cpu_watchpoint_insert(cs, dbreaka & mask, ~mask + 1,
|
||||||
flags, &env->cpu_watchpoint[i])) {
|
flags, &env->cpu_watchpoint[i])) {
|
||||||
env->cpu_watchpoint[i] = NULL;
|
env->cpu_watchpoint[i] = NULL;
|
||||||
qemu_log("Failed to set data breakpoint at 0x%08x/%d\n",
|
qemu_log("Failed to set data breakpoint at 0x%08x/%d\n",
|
||||||
@ -834,7 +835,9 @@ void HELPER(wsr_dbreakc)(CPUXtensaState *env, uint32_t i, uint32_t v)
|
|||||||
set_dbreak(env, i, env->sregs[DBREAKA + i], v);
|
set_dbreak(env, i, env->sregs[DBREAKA + i], v);
|
||||||
} else {
|
} else {
|
||||||
if (env->cpu_watchpoint[i]) {
|
if (env->cpu_watchpoint[i]) {
|
||||||
cpu_watchpoint_remove_by_ref(env, env->cpu_watchpoint[i]);
|
CPUState *cs = CPU(xtensa_env_get_cpu(env));
|
||||||
|
|
||||||
|
cpu_watchpoint_remove_by_ref(cs, env->cpu_watchpoint[i]);
|
||||||
env->cpu_watchpoint[i] = NULL;
|
env->cpu_watchpoint[i] = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user