RtlZeroMemory(KdbTrapFrame, sizeof(KDB_KTRAP_FRAME));
StackPtr = (ULONG_PTR *) KernelStack;
+#ifdef _M_IX86
KdbTrapFrame->Tf.Ebp = StackPtr[3];
KdbTrapFrame->Tf.Edi = StackPtr[4];
KdbTrapFrame->Tf.Esi = StackPtr[5];
KdbTrapFrame->Tf.SegDs = KGDT_R0_DATA;
KdbTrapFrame->Tf.SegEs = KGDT_R0_DATA;
KdbTrapFrame->Tf.SegGs = KGDT_R0_DATA;
+#endif
/* FIXME: what about the other registers??? */
}
}
/* Get the interrupt descriptor */
- if (!NT_SUCCESS(KdbpSafeReadMemory(IntDesc, (PVOID)(Idtr.Base + (IntVect * 8)), sizeof (IntDesc))))
+ if (!NT_SUCCESS(KdbpSafeReadMemory(IntDesc, (PVOID)(ULONG_PTR)(Idtr.Base + (IntVect * 8)), sizeof (IntDesc))))
{
/*KdbpPrint("Couldn't access memory at 0x%p\n", (ULONG_PTR)Idtr.Base + (IntVect * 8));*/
return FALSE;
/* Get a pointer to the thread */
if (!NT_SUCCESS(PsLookupThreadByThreadId(ThreadId, &Thread)))
{
- KdbpPrint("Invalid thread id: 0x%08x\n", (ULONG)ThreadId);
+ KdbpPrint("Invalid thread id: 0x%08x\n", (ULONG_PTR)ThreadId);
return FALSE;
}
Process = Thread->ThreadsProcess;
/* Get a pointer to the process */
if (!NT_SUCCESS(PsLookupProcessByProcessId(ProcessId, &Process)))
{
- KdbpPrint("Invalid process id: 0x%08x\n", (ULONG)ProcessId);
+ KdbpPrint("Invalid process id: 0x%08x\n", (ULONG_PTR)ProcessId);
return FALSE;
}
ObDereferenceObject(Process);
if (Entry == &KdbCurrentProcess->ThreadListHead)
{
- KdbpPrint("No threads in process 0x%08x, cannot attach to process!\n", (ULONG)ProcessId);
+ KdbpPrint("No threads in process 0x%p, cannot attach to process!\n", ProcessId);
return FALSE;
}
SavedStackLimit = Thread->Tcb.StackLimit;
SavedKernelStack = Thread->Tcb.KernelStack;
Thread->Tcb.InitialStack = Thread->Tcb.StackBase = (char*)KdbStack + KDB_STACK_SIZE;
- Thread->Tcb.StackLimit = (ULONG)KdbStack;
+ Thread->Tcb.StackLimit = (ULONG_PTR)KdbStack;
Thread->Tcb.KernelStack = (char*)KdbStack + KDB_STACK_SIZE;
/*KdbpPrint("Switching to KDB stack 0x%08x-0x%08x (Current Stack is 0x%08x)\n", Thread->Tcb.StackLimit, Thread->Tcb.StackBase, Esp);*/
/* Delete the temporary breakpoint which was used to step over or into the instruction. */
KdbpDeleteBreakPoint(-1, BreakPoint);
+ TrapFrame->Eip--;
+
if (--KdbNumSingleSteps > 0)
{
if ((KdbSingleStepOver && !KdbpStepOverInstruction(TrapFrame->Eip)) ||
/* Clear dr6 status flags. */
TrapFrame->Dr6 &= ~0x0000e00f;
- /* Skip the current instruction */
- Context->Eip++;
+ if (!(KdbEnteredOnSingleStep && KdbSingleStepOver))
+ {
+ /* Skip the current instruction */
+ Context->Eip++;
+ }
}
return ContinueType;
while (p1 && (p2 = strchr(p1, ' ')))
{
- p2++;
+ p2 += 2;
if (!_strnicmp(p2, "KDSERIAL", 8))
{
p2 += 8;
KdbDebugState |= KD_DEBUG_KDNOECHO;
}
+ else if (!_strnicmp(p2, "FIRSTCHANCE", 11))
+ {
+ p2 += 11;
+ KdbpSetEnterCondition(-1, TRUE, KdbEnterAlways);
+ }
p1 = p2;
}