Author: fireball
Date: Mon May 19 05:04:21 2008
New Revision: 33597
URL:
http://svn.reactos.org/svn/reactos?rev=33597&view=rev
Log:
- Implement restoring DRx registers if the thread is being debugged.
Modified:
trunk/reactos/ntoskrnl/ke/i386/usercall_asm.S
Modified: trunk/reactos/ntoskrnl/ke/i386/usercall_asm.S
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/usercall_…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/usercall_asm.S [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/i386/usercall_asm.S [iso-8859-1] Mon May 19 05:04:21 2008
@@ -318,6 +318,8 @@
test byte ptr [eax+KTHREAD_DEBUG_ACTIVE], 0xFF
jnz RestoreDebug
+RestoreStack:
+
/* Get TSS */
mov edx, fs:[KPCR_TSS]
@@ -379,10 +381,25 @@
jmp CheckDebug
RestoreDebug:
-
- /* Not yet supported */
- int 3
- jmp $
+ /* Get a pointer to thread's trap frame */
+ mov esi, [eax+KTHREAD_TRAP_FRAME]
+
+ /* Copy debug registers data from it */
+ mov edx, [esi+KTRAP_FRAME_DR0]
+ mov [edi+KTRAP_FRAME_DR0], edx
+ mov edx, [esi+KTRAP_FRAME_DR1]
+ mov [edi+KTRAP_FRAME_DR1], edx
+ mov edx, [esi+KTRAP_FRAME_DR2]
+ mov [edi+KTRAP_FRAME_DR2], edx
+ mov edx, [esi+KTRAP_FRAME_DR3]
+ mov [edi+KTRAP_FRAME_DR3], edx
+ mov edx, [esi+KTRAP_FRAME_DR6]
+ mov [edi+KTRAP_FRAME_DR6], edx
+ mov edx, [esi+KTRAP_FRAME_DR7]
+ mov [edi+KTRAP_FRAME_DR7], edx
+
+ /* Jump back */
+ jmp RestoreStack
NoStack: