[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 13/15] Add debug exception hook
From: |
Jan Kiszka |
Subject: |
[Qemu-devel] [PATCH 13/15] Add debug exception hook |
Date: |
Mon, 23 Jun 2008 16:32:42 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 |
This patch allows to hook into the delivery of EXCP_DEBUG so that other
use beyond guest debugging becomes possible.
Signed-off-by: Jan Kiszka <address@hidden>
---
cpu-exec.c | 13 +++++++++++++
exec-all.h | 4 ++++
2 files changed, 17 insertions(+)
Index: b/cpu-exec.c
===================================================================
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -228,6 +228,16 @@ static inline TranslationBlock *tb_find_
return tb;
}
+static CPUDebugExcpHandler *debug_excp_handler;
+
+CPUDebugExcpHandler *cpu_set_debug_excp_handler(CPUDebugExcpHandler *handler)
+{
+ CPUDebugExcpHandler *old_handler = debug_excp_handler;
+
+ debug_excp_handler = handler;
+ return old_handler;
+}
+
static void cpu_handle_debug_exception(CPUState *env)
{
CPUWatchpoint *wp;
@@ -235,6 +245,9 @@ static void cpu_handle_debug_exception(C
if (!env->watchpoint_hit)
for (wp = env->watchpoints; wp != NULL; wp = wp->next)
wp->flags &= ~BP_WATCHPOINT_HIT;
+
+ if (debug_excp_handler)
+ debug_excp_handler(env);
}
/* main execution loop */
Index: b/exec-all.h
===================================================================
--- a/exec-all.h
+++ b/exec-all.h
@@ -393,3 +393,7 @@ static inline int kqemu_is_ok(CPUState *
}
#endif
+
+typedef void (CPUDebugExcpHandler)(CPUState *env);
+
+CPUDebugExcpHandler *cpu_set_debug_excp_handler(CPUDebugExcpHandler *handler);
- [Qemu-devel] [PATCH 0/15] Enhance debugging support, Jan Kiszka, 2008/06/23
- [Qemu-devel] [PATCH 8/15] Respect length of watchpoints, Jan Kiszka, 2008/06/23
- [Qemu-devel] [PATCH 2/15] Introduce SSTEP_INTERNAL, Jan Kiszka, 2008/06/23
- [Qemu-devel] [PATCH 12/15] Introduce BP_WATCHPOINT_HIT flag, Jan Kiszka, 2008/06/23
- [Qemu-devel] [PATCH 5/15] Return appropriate watch message to gdb, Jan Kiszka, 2008/06/23
- [Qemu-devel] [PATCH 6/15] Refactor and enhance break/watchpoint API - v5, Jan Kiszka, 2008/06/23
- [Qemu-devel] [PATCH 14/15] Introduce BP_CPU as a breakpoint type, Jan Kiszka, 2008/06/23
- [Qemu-devel] [PATCH 1/15] Convert remaining __builtin_expect to likely/unlikely, Jan Kiszka, 2008/06/23
- [Qemu-devel] [PATCH 7/15] Extend mem_write_* to mem_access_*, Jan Kiszka, 2008/06/23
- [Qemu-devel] [PATCH 13/15] Add debug exception hook,
Jan Kiszka <=
- [Qemu-devel] [PATCH 3/15] Replace CF_SINGLE_INSN with SSTEP_INTERNAL - v2, Jan Kiszka, 2008/06/23
- [Qemu-devel] [PATCH 15/15] x86: Debug register emulation, Jan Kiszka, 2008/06/23
- [Qemu-devel] [PATCH 10/15] Remove premature memop TB terminations, Jan Kiszka, 2008/06/23
- [Qemu-devel] [PATCH 9/15] Restore pc on watchpoint hits, Jan Kiszka, 2008/06/23
- [Qemu-devel] [PATCH 11/15] Improve debugging of SMP guests - v2, Jan Kiszka, 2008/06/23
- [Qemu-devel] [PATCH 4/15] Remove unused TB cflags, Jan Kiszka, 2008/06/23