[ros-diffs] [sginsberg] 56194: [NTOS] - As a side effect to 45140 one of the "non-used debug features", breaking in with WinDbg, would no longer work. Add this back, as well as the DPC timeout debug check and ...

sginsberg at svn.reactos.org sginsberg at svn.reactos.org
Tue Mar 20 13:39:27 UTC 2012


Author: sginsberg
Date: Tue Mar 20 13:39:25 2012
New Revision: 56194

URL: http://svn.reactos.org/svn/reactos?rev=56194&view=rev
Log:
[NTOS]
- As a side effect to 45140 one of the "non-used debug features", breaking in with WinDbg, would no longer work. Add this back, as well as the DPC timeout debug check and support for skipping ticks.

Modified:
    trunk/reactos/ntoskrnl/ke/time.c

Modified: trunk/reactos/ntoskrnl/ke/time.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/time.c?rev=56194&r1=56193&r2=56194&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/ke/time.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/time.c [iso-8859-1] Tue Mar 20 13:39:25 2012
@@ -69,6 +69,17 @@
     ULARGE_INTEGER CurrentTime, InterruptTime;
     LONG OldTickOffset;
 
+    /* Check if this tick is being skipped */
+    if (Prcb->SkipTick)
+    {
+        /* Handle it next time */
+        Prcb->SkipTick = FALSE;
+
+        /* Increase interrupt count and end the interrupt */
+        Prcb->InterruptCount++;
+        KiEndInterrupt(Irql, TrapFrame);
+    }
+
     /* Add the increment time to the shared data */
     InterruptTime.QuadPart = *(ULONGLONG*)&SharedUserData->InterruptTime;
     InterruptTime.QuadPart += Increment;
@@ -80,6 +91,13 @@
     /* Update the tick offset */
     OldTickOffset = InterlockedExchangeAdd(&KiTickOffset, -(LONG)Increment);
 
+    /* If the debugger is enabled, check for break-in request */
+    if (KdDebuggerEnabled && KdPollBreakIn())
+    {
+        /* Break-in requested! */
+        DbgBreakPointWithStatus(DBG_STATUS_CONTROL_C);
+    }
+
     /* Check for full tick */
     if (OldTickOffset <= (LONG)Increment)
     {
@@ -121,6 +139,14 @@
 {
     PKTHREAD Thread = KeGetCurrentThread();
     PKPRCB Prcb = KeGetCurrentPrcb();
+
+    /* Check if this tick is being skipped */
+    if (Prcb->SkipTick)
+    {
+        /* Handle it next time */
+        Prcb->SkipTick = FALSE;
+        return;
+    }
 
     /* Increase interrupt count */
     Prcb->InterruptCount++;
@@ -154,6 +180,24 @@
         {
             /* Handle being in a DPC */
             Prcb->DpcTime++;
+
+#if DBG
+            /* Update the DPC time */
+            Prcb->DebugDpcTime++;
+
+            /* Check if we have timed out */
+            if (Prcb->DebugDpcTime == KiDPCTimeout);
+            {
+                /* We did! */
+                DbgPrint("*** DPC routine > 1 sec --- This is not a break in KeUpdateSystemTime\n");
+
+                /* Break if debugger is enabled */
+                if (KdDebuggerEnabled) DbgBreakPoint();
+
+                /* Clear state */
+                Prcb->DebugDpcTime = 0;
+            }
+#endif
         }
     }
 




More information about the Ros-diffs mailing list