[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 32/45] windbg: implemented windbg_set_dr7
From: |
Mihail Abakumov |
Subject: |
[Qemu-devel] [PATCH v3 32/45] windbg: implemented windbg_set_dr7 |
Date: |
Tue, 21 Nov 2017 17:10:16 +0300 |
User-agent: |
StGit/0.17.1-dirty |
Signed-off-by: Mihail Abakumov <address@hidden>
Signed-off-by: Pavel Dovgalyuk <address@hidden>
Signed-off-by: Dmitriy Koltunov <address@hidden>
---
target/i386/windbgstub.c | 27 ++++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)
diff --git a/target/i386/windbgstub.c b/target/i386/windbgstub.c
index 14ad195107..deb0e728e0 100755
--- a/target/i386/windbgstub.c
+++ b/target/i386/windbgstub.c
@@ -299,7 +299,32 @@ static int windbg_hw_breakpoint_remove(CPUState *cpu, int
index)
}
static void windbg_set_dr7(CPUState *cpu, target_ulong new_dr7)
-{}
+{
+ CPUArchState *env = cpu->env_ptr;
+ target_ulong old_dr7 = env->dr[7];
+ int iobpt = 0;
+ int i;
+
+ new_dr7 |= DR7_FIXED_1;
+ if (new_dr7 == old_dr7) {
+ return;
+ }
+
+ for (i = 0; i < DR7_MAX_BP; i++) {
+ if (IS_BP_ENABLED(old_dr7, i) && !IS_BP_ENABLED(new_dr7, i)) {
+ windbg_hw_breakpoint_remove(cpu, i);
+ }
+ }
+
+ env->dr[7] = new_dr7;
+ for (i = 0; i < DR7_MAX_BP; i++) {
+ if (IS_BP_ENABLED(env->dr[7], i)) {
+ iobpt |= windbg_hw_breakpoint_insert(cpu, i);
+ }
+ }
+
+ env->hflags = (env->hflags & ~HF_IOBPT_MASK) | iobpt;
+}
static void windbg_set_dr(CPUState *cpu, int index, target_ulong value)
{
- [Qemu-devel] [PATCH v3 24/45] windbg: implemented kd_api_get_context and kd_api_set_context, (continued)
- [Qemu-devel] [PATCH v3 24/45] windbg: implemented kd_api_get_context and kd_api_set_context, Mihail Abakumov, 2017/11/21
- [Qemu-devel] [PATCH v3 23/45] windbg: kernel's structures, Mihail Abakumov, 2017/11/21
- [Qemu-devel] [PATCH v3 26/45] windbg: implemented windbg_read_context, Mihail Abakumov, 2017/11/21
- [Qemu-devel] [PATCH v3 25/45] windbg: implemented kd_api_read_control_space and kd_api_write_control_space, Mihail Abakumov, 2017/11/21
- [Qemu-devel] [PATCH v3 27/45] windbg: implemented windbg_write_context, Mihail Abakumov, 2017/11/21
- [Qemu-devel] [PATCH v3 28/45] windbg: implemented windbg_read_ks_regs, Mihail Abakumov, 2017/11/21
- [Qemu-devel] [PATCH v3 29/45] windbg: implemented windbg_write_ks_regs, Mihail Abakumov, 2017/11/21
- [Qemu-devel] [PATCH v3 30/45] windbg: implemented windbg_set_sr, Mihail Abakumov, 2017/11/21
- [Qemu-devel] [PATCH v3 31/45] windbg: implemented windbg_set_dr, Mihail Abakumov, 2017/11/21
- [Qemu-devel] [PATCH v3 32/45] windbg: implemented windbg_set_dr7,
Mihail Abakumov <=
- [Qemu-devel] [PATCH v3 33/45] windbg: implemented windbg_hw_breakpoint_insert and windbg_hw_breakpoint_remove, Mihail Abakumov, 2017/11/21
- [Qemu-devel] [PATCH v3 34/45] windbg: implemented kd_api_write_breakpoint and kd_api_restore_breakpoint, Mihail Abakumov, 2017/11/21
- [Qemu-devel] [PATCH v3 35/45] windbg: debug exception subscribing, Mihail Abakumov, 2017/11/21
- [Qemu-devel] [PATCH v3 36/45] windbg: implemented kd_api_continue, Mihail Abakumov, 2017/11/21
- [Qemu-devel] [PATCH v3 37/45] windbg: implemented kd_api_read_io_space and kd_api_write_io_space, Mihail Abakumov, 2017/11/21
- [Qemu-devel] [PATCH v3 38/45] windbg: implemented kd_api_read_physical_memory and kd_api_write_physical_memory, Mihail Abakumov, 2017/11/21
- [Qemu-devel] [PATCH v3 39/45] windbg: implemented kd_api_get_version, Mihail Abakumov, 2017/11/21
- [Qemu-devel] [PATCH v3 40/45] windbg: implemented kd_api_read_msr and kd_api_write_msr, Mihail Abakumov, 2017/11/21