diff options
author | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-11-18 20:07:32 +0000 |
---|---|---|
committer | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-11-18 20:07:32 +0000 |
commit | b81e20ab820a97c45a89fd81cfa8fc0e9740e242 (patch) | |
tree | d8062f3891754bd62a26bfd58613b5c74fb029c3 /cpu-defs.h | |
parent | 720df0f27817f100fdb0cad8e9933b8af92ddc48 (diff) | |
download | qemu-b81e20ab820a97c45a89fd81cfa8fc0e9740e242.tar.gz qemu-b81e20ab820a97c45a89fd81cfa8fc0e9740e242.tar.bz2 qemu-b81e20ab820a97c45a89fd81cfa8fc0e9740e242.zip |
Refactor and enhance break/watchpoint API (Jan Kiszka)
This patch prepares the QEMU cpu_watchpoint/breakpoint API to allow the
succeeding enhancements this series comes with.
First of all, it overcomes MAX_BREAKPOINTS/MAX_WATCHPOINTS by switching
to dynamically allocated data structures that are kept in linked lists.
This also allows to return a stable reference to the related objects,
required for later introduced x86 debug register support.
Breakpoints and watchpoints are stored with their full information set
and an additional flag field that makes them easily extensible for use
beyond pure guest debugging.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5738 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'cpu-defs.h')
-rw-r--r-- | cpu-defs.h | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/cpu-defs.h b/cpu-defs.h index 46d4487811..069d312e1e 100644 --- a/cpu-defs.h +++ b/cpu-defs.h @@ -82,8 +82,6 @@ typedef uint64_t target_phys_addr_t; #define EXCP_HLT 0x10001 /* hlt instruction reached */ #define EXCP_DEBUG 0x10002 /* cpu stopped after a breakpoint or singlestep */ #define EXCP_HALTED 0x10003 /* cpu is halted (waiting for external event) */ -#define MAX_BREAKPOINTS 32 -#define MAX_WATCHPOINTS 32 #define TB_JMP_CACHE_BITS 12 #define TB_JMP_CACHE_SIZE (1 << TB_JMP_CACHE_BITS) @@ -145,6 +143,19 @@ typedef struct icount_decr_u16 { struct kvm_run; struct KVMState; +typedef struct CPUBreakpoint { + target_ulong pc; + int flags; /* BP_* */ + struct CPUBreakpoint *prev, *next; +} CPUBreakpoint; + +typedef struct CPUWatchpoint { + target_ulong vaddr; + target_ulong len_mask; + int flags; /* BP_* */ + struct CPUWatchpoint *prev, *next; +} CPUWatchpoint; + #define CPU_TEMP_BUF_NLONGS 128 #define CPU_COMMON \ struct TranslationBlock *current_tb; /* currently executing TB */ \ @@ -177,16 +188,11 @@ struct KVMState; \ /* from this point: preserved by CPU reset */ \ /* ice debug support */ \ - target_ulong breakpoints[MAX_BREAKPOINTS]; \ - int nb_breakpoints; \ + CPUBreakpoint *breakpoints; \ int singlestep_enabled; \ \ - struct { \ - target_ulong vaddr; \ - int type; /* PAGE_READ/PAGE_WRITE */ \ - } watchpoint[MAX_WATCHPOINTS]; \ - int nb_watchpoints; \ - int watchpoint_hit; \ + CPUWatchpoint *watchpoints; \ + CPUWatchpoint *watchpoint_hit; \ \ struct GDBRegisterState *gdb_regs; \ \ |