[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 2/4] exec: extract TB watchpoint check
From: |
Blue Swirl |
Subject: |
[Qemu-devel] [PATCH 2/4] exec: extract TB watchpoint check |
Date: |
Tue, 4 Dec 2012 21:20:17 +0000 |
Will be moved by the next patch.
Signed-off-by: Blue Swirl <address@hidden>
---
exec.c | 22 ++++++++++++++--------
1 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/exec.c b/exec.c
index 6efd93e..7ee0650 100644
--- a/exec.c
+++ b/exec.c
@@ -2985,12 +2985,24 @@ static const MemoryRegionOps notdirty_mem_ops = {
.endianness = DEVICE_NATIVE_ENDIAN,
};
+static void tb_check_watchpoint(CPUArchState *env)
+{
+ TranslationBlock *tb;
+
+ tb = tb_find_pc(env->mem_io_pc);
+ if (!tb) {
+ cpu_abort(env, "check_watchpoint: could not find TB for pc=%p",
+ (void *)env->mem_io_pc);
+ }
+ cpu_restore_state(tb, env, env->mem_io_pc);
+ tb_phys_invalidate(tb, -1);
+}
+
/* Generate a debug exception if a watchpoint has been hit. */
static void check_watchpoint(int offset, int len_mask, int flags)
{
CPUArchState *env = cpu_single_env;
target_ulong pc, cs_base;
- TranslationBlock *tb;
target_ulong vaddr;
CPUWatchpoint *wp;
int cpu_flags;
@@ -3009,13 +3021,7 @@ static void check_watchpoint(int offset, int len_mask,
int flags)
wp->flags |= BP_WATCHPOINT_HIT;
if (!env->watchpoint_hit) {
env->watchpoint_hit = wp;
- tb = tb_find_pc(env->mem_io_pc);
- if (!tb) {
- cpu_abort(env, "check_watchpoint: could not find TB for "
- "pc=%p", (void *)env->mem_io_pc);
- }
- cpu_restore_state(tb, env, env->mem_io_pc);
- tb_phys_invalidate(tb, -1);
+ tb_check_watchpoint(env);
if (wp->flags & BP_STOP_BEFORE_ACCESS) {
env->exception_index = EXCP_DEBUG;
cpu_loop_exit(env);
--
1.7.2.5
- [Qemu-devel] [PATCH 0/4] exec.c refactoring, Blue Swirl, 2012/12/04
- [Qemu-devel] [PATCH 2/4] exec: extract TB watchpoint check,
Blue Swirl <=
- [Qemu-devel] [PATCH 3/4] exec: move TB handling to translate-all.c, Blue Swirl, 2012/12/04
- [Qemu-devel] [PATCH 1/4] exec: fix coding style, Blue Swirl, 2012/12/04
- [Qemu-devel] [PATCH 4/4] exec: refactor cpu_restore_state, Blue Swirl, 2012/12/04
- Re: [Qemu-devel] [PATCH 4/4] exec: refactor cpu_restore_state, Andreas Färber, 2012/12/05
- Re: [Qemu-devel] [PATCH 4/4] exec: refactor cpu_restore_state, Aurelien Jarno, 2012/12/06