Author: ion
Date: Tue Feb 20 07:57:43 2007
New Revision: 25855
URL:
http://svn.reactos.org/svn/reactos?rev=25855&view=rev
Log:
- Implement KdpGetStateChange.
- Implement DbgKdContinueApi and DbgKdContinueApi2 cases.
- Remove several while (TRUE);s which started being hit since our code is working fine.
- WinDBG gets notifications for all the drivers/symbols being loaded and ROS now boots to
bootvid logo, but we don't yet break-in.
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
branches/alex-kd-branch/reactos/ntoskrnl/kd64/kdinit.c
branches/alex-kd-branch/reactos/ntoskrnl/kd64/kdprint.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…
==============================================================================
--- branches/alex-kd-branch/reactos/ntoskrnl/include/internal/kd.h (original)
+++ branches/alex-kd-branch/reactos/ntoskrnl/include/internal/kd.h Tue Feb 20 07:57:43
2007
@@ -210,3 +210,4 @@
extern BOOLEAN KdpOweBreakpoint;
extern BOOLEAN BreakpointsSuspended;
extern ULONG KdpNumInternalBreakpoints;
+extern ULONG KdpCurrentSymbolStart, KdpCurrentSymbolEnd;
Modified: branches/alex-kd-branch/reactos/ntoskrnl/kd64/kdapi.c
URL:
http://svn.reactos.org/svn/reactos/branches/alex-kd-branch/reactos/ntoskrnl…
==============================================================================
--- branches/alex-kd-branch/reactos/ntoskrnl/kd64/kdapi.c (original)
+++ branches/alex-kd-branch/reactos/ntoskrnl/kd64/kdapi.c Tue Feb 20 07:57:43 2007
@@ -13,6 +13,50 @@
#include <debug.h>
/* PRIVATE FUNCTIONS *********************************************************/
+
+VOID
+NTAPI
+KdpGetStateChange(IN PDBGKD_MANIPULATE_STATE64 State,
+ IN PCONTEXT Context)
+{
+ PKPRCB Prcb;
+ ULONG i;
+
+ /* Check for success */
+ if (NT_SUCCESS(State->u.Continue2.ContinueStatus))
+ {
+ /* Check if we're tracing */
+ if (State->u.Continue2.ControlSet.TraceFlag)
+ {
+ /* Enable TF */
+ Context->EFlags |= EFLAGS_TF;
+ }
+ else
+ {
+ /* Remove it */
+ Context->EFlags &= ~EFLAGS_TF;
+ }
+
+ /* Loop all processors */
+ for (i = 0; i < KeNumberProcessors; i++)
+ {
+ /* Get the PRCB and update DR7 and DR6 */
+ Prcb = KiProcessorBlock[i];
+ Prcb->ProcessorState.SpecialRegisters.KernelDr7 =
+ State->u.Continue2.ControlSet.Dr7;
+ Prcb->ProcessorState.SpecialRegisters.KernelDr6 = 0;
+ }
+
+ /* Check if we have new symbol information */
+ if (State->u.Continue2.ControlSet.CurrentSymbolStart != 1)
+ {
+ /* Update it */
+ KdpCurrentSymbolStart =
+ State->u.Continue2.ControlSet.CurrentSymbolStart;
+ KdpCurrentSymbolEnd= State->u.Continue2.ControlSet.CurrentSymbolEnd;
+ }
+ }
+}
VOID
NTAPI
@@ -507,10 +551,8 @@
case DbgKdContinueApi:
- /* FIXME: TODO */
- Ke386SetCr2(DbgKdContinueApi);
- while (TRUE);
- break;
+ /* Simply continue */
+ return NT_SUCCESS(ManipulateState.u.Continue.ContinueStatus);
case DbgKdReadControlSpaceApi:
@@ -547,9 +589,18 @@
case DbgKdContinueApi2:
- /* FIXME: TODO */
- Ke386SetCr2(DbgKdContinueApi2);
- while (TRUE);
+ /* Check if caller reports success */
+ if (NT_SUCCESS(ManipulateState.u.Continue2.ContinueStatus))
+ {
+ /* Update the state */
+ KdpGetStateChange(&ManipulateState, Context);
+ return ContinueSuccess;
+ }
+ else
+ {
+ /* Return an error */
+ return ContinueError;
+ }
break;
case DbgKdReadPhysicalMemoryApi:
@@ -817,7 +868,6 @@
} while(Status == ContinueProcessorReselected);
/* Return status */
- while (TRUE);
return Status;
}
Modified: branches/alex-kd-branch/reactos/ntoskrnl/kd64/kddata.c
URL:
http://svn.reactos.org/svn/reactos/branches/alex-kd-branch/reactos/ntoskrnl…
==============================================================================
--- branches/alex-kd-branch/reactos/ntoskrnl/kd64/kddata.c (original)
+++ branches/alex-kd-branch/reactos/ntoskrnl/kd64/kddata.c Tue Feb 20 07:57:43 2007
@@ -53,6 +53,8 @@
BOOLEAN KdpOweBreakpoint;
BOOLEAN BreakpointsSuspended;
ULONG KdpNumInternalBreakpoints;
+
+ULONG KdpCurrentSymbolStart, KdpCurrentSymbolEnd;
//
// Time Slip Support
Modified: branches/alex-kd-branch/reactos/ntoskrnl/kd64/kdinit.c
URL:
http://svn.reactos.org/svn/reactos/branches/alex-kd-branch/reactos/ntoskrnl…
==============================================================================
--- branches/alex-kd-branch/reactos/ntoskrnl/kd64/kdinit.c (original)
+++ branches/alex-kd-branch/reactos/ntoskrnl/kd64/kdinit.c Tue Feb 20 07:57:43 2007
@@ -248,7 +248,6 @@
/* Check for incoming breakin and break on symbol load if we have it*/
KdBreakAfterSymbolLoad = KdPollBreakIn();
- while (TRUE);
}
else
{
Modified: branches/alex-kd-branch/reactos/ntoskrnl/kd64/kdprint.c
URL:
http://svn.reactos.org/svn/reactos/branches/alex-kd-branch/reactos/ntoskrnl…
==============================================================================
--- branches/alex-kd-branch/reactos/ntoskrnl/kd64/kdprint.c (original)
+++ branches/alex-kd-branch/reactos/ntoskrnl/kd64/kdprint.c Tue Feb 20 07:57:43 2007
@@ -101,7 +101,7 @@
RtlCopyMemory(ContextRecord,
&Prcb->ProcessorState.ContextFrame,
sizeof(CONTEXT));
- KiRestoreProcessorControlState(&Prcb->ProcessorState);
+ //KiRestoreProcessorControlState(&Prcb->ProcessorState);
/* Exit the debugger and clear the CTRL-C state */
KdExitDebugger(Entered);