- 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.

svn path=/branches/alex-kd-branch/; revision=25855
This commit is contained in:
Alex Ionescu 2007-02-20 04:57:43 +00:00
parent 69a6af0124
commit 86bcfc31af
5 changed files with 62 additions and 10 deletions

View file

@ -210,3 +210,4 @@ extern ULONG KdpBreakpointInstruction;
extern BOOLEAN KdpOweBreakpoint;
extern BOOLEAN BreakpointsSuspended;
extern ULONG KdpNumInternalBreakpoints;
extern ULONG KdpCurrentSymbolStart, KdpCurrentSymbolEnd;

View file

@ -14,6 +14,50 @@
/* 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
KdpSetCommonState(IN ULONG NewState,
@ -507,10 +551,8 @@ SendPacket:
case DbgKdContinueApi:
/* FIXME: TODO */
Ke386SetCr2(DbgKdContinueApi);
while (TRUE);
break;
/* Simply continue */
return NT_SUCCESS(ManipulateState.u.Continue.ContinueStatus);
case DbgKdReadControlSpaceApi:
@ -547,9 +589,18 @@ SendPacket:
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 @@ KdpReportLoadSymbolsStateChange(IN PSTRING PathName,
} while(Status == ContinueProcessorReselected);
/* Return status */
while (TRUE);
return Status;
}

View file

@ -54,6 +54,8 @@ BOOLEAN KdpOweBreakpoint;
BOOLEAN BreakpointsSuspended;
ULONG KdpNumInternalBreakpoints;
ULONG KdpCurrentSymbolStart, KdpCurrentSymbolEnd;
//
// Time Slip Support
//

View file

@ -248,7 +248,6 @@ KdInitSystem(IN ULONG BootPhase,
/* Check for incoming breakin and break on symbol load if we have it*/
KdBreakAfterSymbolLoad = KdPollBreakIn();
while (TRUE);
}
else
{

View file

@ -101,7 +101,7 @@ KdpSymbol(IN PSTRING DllPath,
RtlCopyMemory(ContextRecord,
&Prcb->ProcessorState.ContextFrame,
sizeof(CONTEXT));
KiRestoreProcessorControlState(&Prcb->ProcessorState);
//KiRestoreProcessorControlState(&Prcb->ProcessorState);
/* Exit the debugger and clear the CTRL-C state */
KdExitDebugger(Entered);