[ros-diffs] [ion] 25851: - Implement DbgKdClearAllInternalBreakpointsApi - Implement KdpGetContext for DbgKdGetContextApi. - WinDBG now goes to Phase 2 connection and prints out: Windows Server 2003 Kernel Version 3790 UP Checked x86 compatible Built by: 20070215-r25797 Kernel base = 0x80100000 PsLoadedModuleList = 0x80112230

ion at svn.reactos.org ion at svn.reactos.org
Tue Feb 20 03:12:40 CET 2007


Author: ion
Date: Tue Feb 20 05:12:39 2007
New Revision: 25851

URL: http://svn.reactos.org/svn/reactos?rev=25851&view=rev
Log:
- Implement DbgKdClearAllInternalBreakpointsApi
- Implement KdpGetContext for DbgKdGetContextApi.
- WinDBG now goes to Phase 2 connection and prints out:
Windows Server 2003 Kernel Version 3790 UP Checked x86 compatible
Built by: 20070215-r25797
Kernel base = 0x80100000 PsLoadedModuleList = 0x80112230

Modified:
    branches/alex-kd-branch/reactos/ntoskrnl/include/internal/kd.h
    branches/alex-kd-branch/reactos/ntoskrnl/kd64/kdapi.c
    branches/alex-kd-branch/reactos/ntoskrnl/kd64/kddata.c

Modified: branches/alex-kd-branch/reactos/ntoskrnl/include/internal/kd.h
URL: http://svn.reactos.org/svn/reactos/branches/alex-kd-branch/reactos/ntoskrnl/include/internal/kd.h?rev=25851&r1=25850&r2=25851&view=diff
==============================================================================
--- branches/alex-kd-branch/reactos/ntoskrnl/include/internal/kd.h (original)
+++ branches/alex-kd-branch/reactos/ntoskrnl/include/internal/kd.h Tue Feb 20 05:12:39 2007
@@ -209,3 +209,4 @@
 extern ULONG KdpBreakpointInstruction;
 extern BOOLEAN KdpOweBreakpoint;
 extern BOOLEAN BreakpointsSuspended;
+extern ULONG KdpNumInternalBreakpoints;

Modified: branches/alex-kd-branch/reactos/ntoskrnl/kd64/kdapi.c
URL: http://svn.reactos.org/svn/reactos/branches/alex-kd-branch/reactos/ntoskrnl/kd64/kdapi.c?rev=25851&r1=25850&r2=25851&view=diff
==============================================================================
--- branches/alex-kd-branch/reactos/ntoskrnl/kd64/kdapi.c (original)
+++ branches/alex-kd-branch/reactos/ntoskrnl/kd64/kdapi.c Tue Feb 20 05:12:39 2007
@@ -276,6 +276,57 @@
                  &KdpContext);
 }
 
+VOID
+NTAPI
+KdpGetContext(IN PDBGKD_MANIPULATE_STATE64 State,
+              IN PSTRING Data,
+              IN PCONTEXT Context)
+{
+    STRING Header;
+    PVOID ControlStart;
+
+    /* Setup the header */
+    Header.Length = sizeof(DBGKD_MANIPULATE_STATE64);
+    Header.Buffer = (PCHAR)State;
+    ASSERT(Data->Length == 0);
+
+    /* Make sure that this is a valid request */
+    if (State->Processor < KeNumberProcessors)
+    {
+        /* Check if the request is for this CPU */
+        if (State->Processor == KeGetCurrentPrcb()->Number)
+        {
+            /* We're just copying our own context */
+            ControlStart = Context;
+        }
+        else
+        {
+            /* SMP not yet handled */
+            ControlStart = NULL;
+            while (TRUE);
+        }
+
+        /* Copy the memory */
+        RtlCopyMemory(Data->Buffer, ControlStart, sizeof(CONTEXT));
+        Data->Length = sizeof(CONTEXT);
+
+        /* Finish up */
+        State->ReturnStatus = STATUS_SUCCESS;
+    }
+    else
+    {
+        /* Invalid request */
+        State->ReturnStatus = STATUS_UNSUCCESSFUL;
+    }
+
+    /* Send the reply */
+    KdSendPacket(PACKET_TYPE_KD_STATE_MANIPULATE,
+                 &Header,
+                 Data,
+                 &KdpContext);
+}
+
+
 KCONTINUE_STATUS
 NTAPI
 KdpSendWaitContinue(IN ULONG PacketType,
@@ -339,8 +390,7 @@
             case DbgKdGetContextApi:
 
                 /* FIXME: TODO */
-                Ke386SetCr2(DbgKdGetContextApi);
-                while (TRUE);
+                KdpGetContext(&ManipulateState, &Data, Context);
                 break;
 
             case DbgKdSetContextApi:
@@ -573,9 +623,8 @@
 
             case DbgKdClearAllInternalBreakpointsApi:
 
-                /* FIXME: TODO */
-                Ke386SetCr2(DbgKdClearAllInternalBreakpointsApi);
-                while (TRUE);
+                /* Just clear the counter */
+                KdpNumInternalBreakpoints = 0;
                 break;
 
             case DbgKdFillMemoryApi:

Modified: branches/alex-kd-branch/reactos/ntoskrnl/kd64/kddata.c
URL: http://svn.reactos.org/svn/reactos/branches/alex-kd-branch/reactos/ntoskrnl/kd64/kddata.c?rev=25851&r1=25850&r2=25851&view=diff
==============================================================================
--- branches/alex-kd-branch/reactos/ntoskrnl/kd64/kddata.c (original)
+++ branches/alex-kd-branch/reactos/ntoskrnl/kd64/kddata.c Tue Feb 20 05:12:39 2007
@@ -52,6 +52,7 @@
 ULONG KdpBreakpointInstruction = 0xCC;
 BOOLEAN KdpOweBreakpoint;
 BOOLEAN BreakpointsSuspended;
+ULONG KdpNumInternalBreakpoints;
 
 //
 // Time Slip Support




More information about the Ros-diffs mailing list