Grazvydas Ignotas : server: Set debug enable bits briefly to commit the addresses to kernel.

Alexandre Julliard julliard at winehq.org
Mon Jul 18 12:46:59 CDT 2011


Module: wine
Branch: master
Commit: 2cc56f379c3a17d3274fc4b7e91ac648e10e641d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=2cc56f379c3a17d3274fc4b7e91ac648e10e641d

Author: Grazvydas Ignotas <notasas at gmail.com>
Date:   Fri Jul 15 23:19:11 2011 +0300

server: Set debug enable bits briefly to commit the addresses to kernel.

---

 dlls/ntdll/tests/exception.c |    1 -
 server/ptrace.c              |    3 +++
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c
index 9f80651..5d3f8c1 100644
--- a/dlls/ntdll/tests/exception.c
+++ b/dlls/ntdll/tests/exception.c
@@ -510,7 +510,6 @@ static void check_debug_registers(int test_num, const struct dbgreg_test *test)
     CHECK_DEBUG_REG(0, ~0);
     CHECK_DEBUG_REG(1, ~0);
     CHECK_DEBUG_REG(2, ~0);
-if (test_num == 2) todo_wine
     CHECK_DEBUG_REG(3, ~0);
     CHECK_DEBUG_REG(6, 0x0f);
     CHECK_DEBUG_REG(7, ~0xdc00);
diff --git a/server/ptrace.c b/server/ptrace.c
index 6df9555..51157ab 100644
--- a/server/ptrace.c
+++ b/server/ptrace.c
@@ -605,6 +605,8 @@ void set_thread_context( struct thread *thread, const context_t *context, unsign
         if (thread->context) thread->context->debug.i386_regs.dr3 = context->debug.i386_regs.dr3;
         if (ptrace( PTRACE_POKEUSER, pid, DR_OFFSET(6), context->debug.i386_regs.dr6 ) == -1) goto error;
         if (thread->context) thread->context->debug.i386_regs.dr6 = context->debug.i386_regs.dr6;
+        /* Linux 2.6.33+ needs enable bits set briefly to update value returned by PEEKUSER later */
+        ptrace( PTRACE_POKEUSER, pid, DR_OFFSET(7), context->debug.i386_regs.dr7 | 0x55 );
         if (ptrace( PTRACE_POKEUSER, pid, DR_OFFSET(7), context->debug.i386_regs.dr7 ) == -1) goto error;
         if (thread->context) thread->context->debug.i386_regs.dr7 = context->debug.i386_regs.dr7;
         break;
@@ -620,6 +622,7 @@ void set_thread_context( struct thread *thread, const context_t *context, unsign
         if (thread->context) thread->context->debug.x86_64_regs.dr3 = context->debug.x86_64_regs.dr3;
         if (ptrace( PTRACE_POKEUSER, pid, DR_OFFSET(6), context->debug.x86_64_regs.dr6 ) == -1) goto error;
         if (thread->context) thread->context->debug.x86_64_regs.dr6 = context->debug.x86_64_regs.dr6;
+        ptrace( PTRACE_POKEUSER, pid, DR_OFFSET(7), context->debug.x86_64_regs.dr7 | 0x55 );
         if (ptrace( PTRACE_POKEUSER, pid, DR_OFFSET(7), context->debug.x86_64_regs.dr7 ) == -1) goto error;
         if (thread->context) thread->context->debug.x86_64_regs.dr7 = context->debug.x86_64_regs.dr7;
         break;




More information about the wine-cvs mailing list