Modified: trunk/reactos/ntoskrnl/kdbg/kdb.c
Modified: trunk/reactos/ntoskrnl/kdbg/kdb_cli.c
Modified: trunk/reactos/ntoskrnl/kdbg/kdb_expr.c
--- trunk/reactos/ntoskrnl/kdbg/kdb.c 2005-11-27 21:00:09 UTC (rev 19699)
+++ trunk/reactos/ntoskrnl/kdbg/kdb.c 2005-11-27 21:31:35 UTC (rev 19700)
@@ -128,9 +128,9 @@
KdbpTrapFrameToKdbTrapFrame(PKTRAP_FRAME TrapFrame, PKDB_KTRAP_FRAME KdbTrapFrame)
{
/* Copy the TrapFrame only up to Eflags and zero the rest*/
- RtlCopyMemory(&KdbTrapFrame->Tf, TrapFrame, FIELD_OFFSET(KTRAP_FRAME, Esp));
- RtlZeroMemory((PVOID)((ULONG_PTR)&KdbTrapFrame->Tf + FIELD_OFFSET(KTRAP_FRAME, Esp)),
- sizeof (KTRAP_FRAME) - FIELD_OFFSET(KTRAP_FRAME, Esp));
+ RtlCopyMemory(&KdbTrapFrame->Tf, TrapFrame, FIELD_OFFSET(KTRAP_FRAME, HardwareEsp));
+ RtlZeroMemory((PVOID)((ULONG_PTR)&KdbTrapFrame->Tf + FIELD_OFFSET(KTRAP_FRAME, HardwareEsp)),
+ sizeof (KTRAP_FRAME) - FIELD_OFFSET(KTRAP_FRAME, HardwareEsp));
asm volatile(
"movl %%cr0, %0" "\n\t"
"movl %%cr2, %1" "\n\t"
@@ -139,8 +139,8 @@
: "=r"(KdbTrapFrame->Cr0), "=r"(KdbTrapFrame->Cr2),
"=r"(KdbTrapFrame->Cr3), "=r"(KdbTrapFrame->Cr4));
- KdbTrapFrame->Tf.Esp = KiEspFromTrapFrame(TrapFrame);
- KdbTrapFrame->Tf.Ss = (USHORT)(KiSsFromTrapFrame(TrapFrame) & 0xFFFF);
+ KdbTrapFrame->Tf.HardwareEsp = KiEspFromTrapFrame(TrapFrame);
+ KdbTrapFrame->Tf.HardwareSegSs = (USHORT)(KiSsFromTrapFrame(TrapFrame) & 0xFFFF);
/* FIXME: copy v86 registers if TrapFrame is a V86 trapframe */
@@ -150,12 +150,12 @@
KdbpKdbTrapFrameToTrapFrame(PKDB_KTRAP_FRAME KdbTrapFrame, PKTRAP_FRAME TrapFrame)
{
/* Copy the TrapFrame only up to Eflags and zero the rest*/
- RtlCopyMemory(TrapFrame, &KdbTrapFrame->Tf, FIELD_OFFSET(KTRAP_FRAME, Esp));
+ RtlCopyMemory(TrapFrame, &KdbTrapFrame->Tf, FIELD_OFFSET(KTRAP_FRAME, HardwareEsp));
/* FIXME: write cr0, cr2, cr3 and cr4 (not needed atm) */
- KiSsToTrapFrame(TrapFrame, KdbTrapFrame->Tf.Ss);
- KiEspToTrapFrame(TrapFrame, KdbTrapFrame->Tf.Esp);
+ KiSsToTrapFrame(TrapFrame, KdbTrapFrame->Tf.HardwareSegSs);
+ KiEspToTrapFrame(TrapFrame, KdbTrapFrame->Tf.HardwareEsp);
/* FIXME: copy v86 registers if TrapFrame is a V86 trapframe */
}
@@ -330,7 +330,7 @@
IntVect = 3;
else if (Mem[0] == 0xcd)
IntVect = Mem[1];
- else if (Mem[0] == 0xce && KdbCurrentTrapFrame->Tf.Eflags & (1<<11)) /* 1 << 11 is the overflow flag */
+ else if (Mem[0] == 0xce && KdbCurrentTrapFrame->Tf.EFlags & (1<<11)) /* 1 << 11 is the overflow flag */
IntVect = 4;
else
return FALSE;
@@ -1177,7 +1177,7 @@
IN OUT PKTRAP_FRAME TrapFrame,
IN BOOLEAN FirstChance)
{
- ULONG ExpNr = (ULONG)TrapFrame->DebugArgMark;
+ ULONG ExpNr = (ULONG)TrapFrame->DbgArgMark;
KDB_ENTER_CONDITION EnterCondition;
KD_CONTINUE_TYPE ContinueType = kdHandleException;
PKDB_BREAKPOINT BreakPoint;
@@ -1245,7 +1245,7 @@
else if (BreakPoint->Type == KdbBreakPointTemporary &&
BreakPoint->Process == KdbCurrentProcess)
{
- ASSERT((TrapFrame->Eflags & X86_EFLAGS_TF) == 0);
+ ASSERT((TrapFrame->EFlags & X86_EFLAGS_TF) == 0);
/*
* Delete the temporary breakpoint which was used to step over or into the instruction.
@@ -1257,7 +1257,7 @@
if ((KdbSingleStepOver && !KdbpStepOverInstruction(TrapFrame->Eip)) ||
(!KdbSingleStepOver && !KdbpStepIntoInstruction(TrapFrame->Eip)))
{
- TrapFrame->Eflags |= X86_EFLAGS_TF;
+ TrapFrame->EFlags |= X86_EFLAGS_TF;
}
goto continue_execution; /* return */
}
@@ -1273,7 +1273,7 @@
BreakPoint->Type == KdbBreakPointTemporary)
{
ASSERT(ExpNr == 3);
- TrapFrame->Eflags |= X86_EFLAGS_TF;
+ TrapFrame->EFlags |= X86_EFLAGS_TF;
KdbBreakPointToReenable = BreakPoint;
}
@@ -1307,7 +1307,7 @@
if (BreakPoint->Type == KdbBreakPointSoftware)
{
DbgPrint("Entered debugger on breakpoint #%d: EXEC 0x%04x:0x%08x\n",
- KdbLastBreakPointNr, TrapFrame->Cs & 0xffff, TrapFrame->Eip);
+ KdbLastBreakPointNr, TrapFrame->SegCs & 0xffff, TrapFrame->Eip);
}
else if (BreakPoint->Type == KdbBreakPointHardware)
{
@@ -1346,7 +1346,7 @@
/* Unset TF if we are no longer single stepping. */
if (KdbNumSingleSteps == 0)
- TrapFrame->Eflags &= ~X86_EFLAGS_TF;
+ TrapFrame->EFlags &= ~X86_EFLAGS_TF;
goto continue_execution; /* return */
}
@@ -1359,16 +1359,16 @@
if ((KdbSingleStepOver && KdbpStepOverInstruction(TrapFrame->Eip)) ||
(!KdbSingleStepOver && KdbpStepIntoInstruction(TrapFrame->Eip)))
{
- TrapFrame->Eflags &= ~X86_EFLAGS_TF;
+ TrapFrame->EFlags &= ~X86_EFLAGS_TF;
}
else
{
- TrapFrame->Eflags |= X86_EFLAGS_TF;
+ TrapFrame->EFlags |= X86_EFLAGS_TF;
}
goto continue_execution; /* return */
}
- TrapFrame->Eflags &= ~X86_EFLAGS_TF;
+ TrapFrame->EFlags &= ~X86_EFLAGS_TF;
KdbEnteredOnSingleStep = TRUE;
}
else
@@ -1393,7 +1393,7 @@
}
DbgPrint("Entered debugger on embedded INT3 at 0x%04x:0x%08x.\n",
- TrapFrame->Cs & 0xffff, TrapFrame->Eip - 1);
+ TrapFrame->SegCs & 0xffff, TrapFrame->Eip - 1);
}
else
{
@@ -1414,7 +1414,7 @@
ULONG_PTR Cr2;
ULONG Err;
asm volatile("movl %%cr2, %0" : "=r"(Cr2));
- Err = TrapFrame->ErrorCode;
+ Err = TrapFrame->ErrCode;
DbgPrint("Memory at 0x%p could not be %s: ", Cr2, (Err & (1 << 1)) ? "written" : "read");
if ((Err & (1 << 0)) == 0)
DbgPrint("Page not present.\n");
@@ -1459,12 +1459,12 @@
if ((KdbSingleStepOver && KdbpStepOverInstruction(KdbCurrentTrapFrame->Tf.Eip)) ||
(!KdbSingleStepOver && KdbpStepIntoInstruction(KdbCurrentTrapFrame->Tf.Eip)))
{
- ASSERT((KdbCurrentTrapFrame->Tf.Eflags & X86_EFLAGS_TF) == 0);
- /*KdbCurrentTrapFrame->Tf.Eflags &= ~X86_EFLAGS_TF;*/
+ ASSERT((KdbCurrentTrapFrame->Tf.EFlags & X86_EFLAGS_TF) == 0);
+ /*KdbCurrentTrapFrame->Tf.EFlags &= ~X86_EFLAGS_TF;*/
}
else
{
- KdbCurrentTrapFrame->Tf.Eflags |= X86_EFLAGS_TF;
+ KdbCurrentTrapFrame->Tf.EFlags |= X86_EFLAGS_TF;
}
}
@@ -1496,7 +1496,7 @@
/* Set the RF flag so we don't trigger the same breakpoint again. */
if (Resume)
{
- TrapFrame->Eflags |= X86_EFLAGS_RF;
+ TrapFrame->EFlags |= X86_EFLAGS_RF;
}
/* Clear dr6 status flags. */
--- trunk/reactos/ntoskrnl/kdbg/kdb_cli.c 2005-11-27 21:00:09 UTC (rev 19699)
+++ trunk/reactos/ntoskrnl/kdbg/kdb_cli.c 2005-11-27 21:31:35 UTC (rev 19700)
@@ -379,28 +379,28 @@
" ECX 0x%08x EDX 0x%08x\n"
" ESI 0x%08x EDI 0x%08x\n"
" EBP 0x%08x\n",
- Tf->Cs & 0xFFFF, Tf->Eip,
- Tf->Ss, Tf->Esp,
+ Tf->SegCs & 0xFFFF, Tf->Eip,
+ Tf->HardwareSegSs, Tf->HardwareEsp,
Tf->Eax, Tf->Ebx,
Tf->Ecx, Tf->Edx,
Tf->Esi, Tf->Edi,
Tf->Ebp);
- KdbpPrint("EFLAGS 0x%08x ", Tf->Eflags);
+ KdbpPrint("EFLAGS 0x%08x ", Tf->EFlags);
for (i = 0; i < 32; i++)
{
if (i == 1)
{
- if ((Tf->Eflags & (1 << 1)) == 0)
+ if ((Tf->EFlags & (1 << 1)) == 0)
KdbpPrint(" !BIT1");
}
else if (i == 12)
{
- KdbpPrint(" IOPL%d", (Tf->Eflags >> 12) & 3);
+ KdbpPrint(" IOPL%d", (Tf->EFlags >> 12) & 3);
}
else if (i == 13)
{
}
- else if ((Tf->Eflags & (1 << i)) != 0)
+ else if ((Tf->EFlags & (1 << i)) != 0)
KdbpPrint(EflagsBits[i]);
}
KdbpPrint("\n");
@@ -461,18 +461,18 @@
else if (Argv[0][0] == 's') /* sregs */
{
KdbpPrint("CS 0x%04x Index 0x%04x %cDT RPL%d\n",
- Tf->Cs & 0xffff, (Tf->Cs & 0xffff) >> 3,
- (Tf->Cs & (1 << 2)) ? 'L' : 'G', Tf->Cs & 3);
+ Tf->SegCs & 0xffff, (Tf->SegCs & 0xffff) >> 3,
+ (Tf->SegCs & (1 << 2)) ? 'L' : 'G', Tf->SegCs & 3);
KdbpPrint("DS 0x%04x Index 0x%04x %cDT RPL%d\n",
- Tf->Ds, Tf->Ds >> 3, (Tf->Ds & (1 << 2)) ? 'L' : 'G', Tf->Ds & 3);
+ Tf->SegDs, Tf->SegDs >> 3, (Tf->SegDs & (1 << 2)) ? 'L' : 'G', Tf->SegDs & 3);
KdbpPrint("ES 0x%04x Index 0x%04x %cDT RPL%d\n",
- Tf->Es, Tf->Es >> 3, (Tf->Es & (1 << 2)) ? 'L' : 'G', Tf->Es & 3);
+ Tf->SegEs, Tf->SegEs >> 3, (Tf->SegEs & (1 << 2)) ? 'L' : 'G', Tf->SegEs & 3);
KdbpPrint("FS 0x%04x Index 0x%04x %cDT RPL%d\n",
- Tf->Fs, Tf->Fs >> 3, (Tf->Fs & (1 << 2)) ? 'L' : 'G', Tf->Fs & 3);
+ Tf->SegFs, Tf->SegFs >> 3, (Tf->SegFs & (1 << 2)) ? 'L' : 'G', Tf->SegFs & 3);
KdbpPrint("GS 0x%04x Index 0x%04x %cDT RPL%d\n",
- Tf->Gs, Tf->Gs >> 3, (Tf->Gs & (1 << 2)) ? 'L' : 'G', Tf->Gs & 3);
+ Tf->SegGs, Tf->SegGs >> 3, (Tf->SegGs & (1 << 2)) ? 'L' : 'G', Tf->SegGs & 3);
KdbpPrint("SS 0x%04x Index 0x%04x %cDT RPL%d\n",
- Tf->Ss, Tf->Ss >> 3, (Tf->Ss & (1 << 2)) ? 'L' : 'G', Tf->Ss & 3);
+ Tf->HardwareSegSs, Tf->HardwareSegSs >> 3, (Tf->HardwareSegSs & (1 << 2)) ? 'L' : 'G', Tf->HardwareSegSs & 3);
}
else /* dregs */
{
@@ -940,10 +940,10 @@
if (Thread->Tcb.TrapFrame != NULL)
{
- if (Thread->Tcb.TrapFrame->PreviousMode == KernelMode)
+ if (Thread->Tcb.TrapFrame->PreviousPreviousMode == KernelMode)
Esp = (PULONG)Thread->Tcb.TrapFrame->TempEsp;
else
- Esp = (PULONG)Thread->Tcb.TrapFrame->Esp;
+ Esp = (PULONG)Thread->Tcb.TrapFrame->HardwareEsp;
Ebp = (PULONG)Thread->Tcb.TrapFrame->Ebp;
Eip = Thread->Tcb.TrapFrame->Eip;
}
@@ -1466,35 +1466,15 @@
KTSS *Tss = KeGetCurrentKPCR()->TSS;
KdbpPrint("Current TSS is at 0x%08x.\n", (INT)Tss);
- KdbpPrint(" PreviousTask: 0x%08x\n"
- " Ss0:Esp0: 0x%04x:0x%08x\n"
- " Ss1:Esp1: 0x%04x:0x%08x\n"
- " Ss2:Esp2: 0x%04x:0x%08x\n"
- " Cr3: 0x%08x\n"
- " Eip: 0x%08x\n"
- " Eflags: 0x%08x\n"
- " Eax: 0x%08x\n"
- " Ecx: 0x%08x\n"
- " Edx: 0x%08x\n"
- " Ebx: 0x%08x\n"
- " Esp: 0x%08x\n"
- " Ebp: 0x%08x\n"
- " Esi: 0x%08x\n"
- " Edi: 0x%08x\n"
+ KdbpPrint(" Eip: 0x%08x\n"
" Es: 0x%04x\n"
" Cs: 0x%04x\n"
" Ss: 0x%04x\n"
" Ds: 0x%04x\n"
" Fs: 0x%04x\n"
" Gs: 0x%04x\n"
- " Ldt: 0x%04x\n"
- " Trap: 0x%04x\n"
" IoMapBase: 0x%04x\n",
- Tss->PreviousTask, Tss->Ss0, Tss->Esp0, Tss->Ss1, Tss->Esp1,
- Tss->Ss2, Tss->Esp2, Tss->Cr3, Tss->Eip, Tss->Eflags, Tss->Eax,
- Tss->Ecx, Tss->Edx, Tss->Ebx, Tss->Esp, Tss->Ebp, Tss->Esi,
- Tss->Edi, Tss->Es, Tss->Cs, Tss->Ss, Tss->Ds, Tss->Fs, Tss->Gs,
- Tss->Ldt, Tss->Trap, Tss->IoMapBase);
+ Tss->Eip, Tss->Es, Tss->Cs, Tss->Ds, Tss->Fs, Tss->Gs, Tss->IoMapBase);
return TRUE;
}
--- trunk/reactos/ntoskrnl/kdbg/kdb_expr.c 2005-11-27 21:00:09 UTC (rev 19699)
+++ trunk/reactos/ntoskrnl/kdbg/kdb_expr.c 2005-11-27 21:31:35 UTC (rev 19700)
@@ -93,21 +93,21 @@
STATIC CONST struct { PCHAR Name; UCHAR Offset; UCHAR Size; } RegisterToTrapFrame[] =
{
{"eip", FIELD_OFFSET(KDB_KTRAP_FRAME, Tf.Eip), RTL_FIELD_SIZE(KDB_KTRAP_FRAME, Tf.Eip)},
- {"eflags", FIELD_OFFSET(KDB_KTRAP_FRAME, Tf.Eflags), RTL_FIELD_SIZE(KDB_KTRAP_FRAME, Tf.Eflags)},
+ {"eflags", FIELD_OFFSET(KDB_KTRAP_FRAME, Tf.EFlags), RTL_FIELD_SIZE(KDB_KTRAP_FRAME, Tf.EFlags)},
{"eax", FIELD_OFFSET(KDB_KTRAP_FRAME, Tf.Eax), RTL_FIELD_SIZE(KDB_KTRAP_FRAME, Tf.Eax)},
{"ebx", FIELD_OFFSET(KDB_KTRAP_FRAME, Tf.Ebx), RTL_FIELD_SIZE(KDB_KTRAP_FRAME, Tf.Ebx)},
{"ecx", FIELD_OFFSET(KDB_KTRAP_FRAME, Tf.Ecx), RTL_FIELD_SIZE(KDB_KTRAP_FRAME, Tf.Ecx)},
{"edx", FIELD_OFFSET(KDB_KTRAP_FRAME, Tf.Edx), RTL_FIELD_SIZE(KDB_KTRAP_FRAME, Tf.Edx)},
{"esi", FIELD_OFFSET(KDB_KTRAP_FRAME, Tf.Esi), RTL_FIELD_SIZE(KDB_KTRAP_FRAME, Tf.Esi)},
{"edi", FIELD_OFFSET(KDB_KTRAP_FRAME, Tf.Edi), RTL_FIELD_SIZE(KDB_KTRAP_FRAME, Tf.Edi)},
- {"esp", FIELD_OFFSET(KDB_KTRAP_FRAME, Tf.Esp), RTL_FIELD_SIZE(KDB_KTRAP_FRAME, Tf.Esp)},
+ {"esp", FIELD_OFFSET(KDB_KTRAP_FRAME, Tf.HardwareEsp), RTL_FIELD_SIZE(KDB_KTRAP_FRAME, Tf.HardwareEsp)},
{"ebp", FIELD_OFFSET(KDB_KTRAP_FRAME, Tf.Ebp), RTL_FIELD_SIZE(KDB_KTRAP_FRAME, Tf.Ebp)},
- {"cs", FIELD_OFFSET(KDB_KTRAP_FRAME, Tf.Cs), 2 }, /* Use only the lower 2 bytes */
- {"ds", FIELD_OFFSET(KDB_KTRAP_FRAME, Tf.Ds), RTL_FIELD_SIZE(KDB_KTRAP_FRAME, Tf.Ds)},
- {"es", FIELD_OFFSET(KDB_KTRAP_FRAME, Tf.Es), RTL_FIELD_SIZE(KDB_KTRAP_FRAME, Tf.Es)},
- {"fs", FIELD_OFFSET(KDB_KTRAP_FRAME, Tf.Fs), RTL_FIELD_SIZE(KDB_KTRAP_FRAME, Tf.Fs)},
- {"gs", FIELD_OFFSET(KDB_KTRAP_FRAME, Tf.Gs), RTL_FIELD_SIZE(KDB_KTRAP_FRAME, Tf.Gs)},
- {"ss", FIELD_OFFSET(KDB_KTRAP_FRAME, Tf.Ss), RTL_FIELD_SIZE(KDB_KTRAP_FRAME, Tf.Ss)},
+ {"cs", FIELD_OFFSET(KDB_KTRAP_FRAME, Tf.SegCs), 2 }, /* Use only the lower 2 bytes */
+ {"ds", FIELD_OFFSET(KDB_KTRAP_FRAME, Tf.SegDs), RTL_FIELD_SIZE(KDB_KTRAP_FRAME, Tf.SegDs)},
+ {"es", FIELD_OFFSET(KDB_KTRAP_FRAME, Tf.SegEs), RTL_FIELD_SIZE(KDB_KTRAP_FRAME, Tf.SegEs)},
+ {"fs", FIELD_OFFSET(KDB_KTRAP_FRAME, Tf.SegFs), RTL_FIELD_SIZE(KDB_KTRAP_FRAME, Tf.SegFs)},
+ {"gs", FIELD_OFFSET(KDB_KTRAP_FRAME, Tf.SegGs), RTL_FIELD_SIZE(KDB_KTRAP_FRAME, Tf.SegGs)},
+ {"ss", FIELD_OFFSET(KDB_KTRAP_FRAME, Tf.HardwareSegSs), RTL_FIELD_SIZE(KDB_KTRAP_FRAME, Tf.HardwareSegSs)},
{"dr0", FIELD_OFFSET(KDB_KTRAP_FRAME, Tf.Dr0), RTL_FIELD_SIZE(KDB_KTRAP_FRAME, Tf.Dr0)},
{"dr1", FIELD_OFFSET(KDB_KTRAP_FRAME, Tf.Dr1), RTL_FIELD_SIZE(KDB_KTRAP_FRAME, Tf.Dr1)},
{"dr2", FIELD_OFFSET(KDB_KTRAP_FRAME, Tf.Dr2), RTL_FIELD_SIZE(KDB_KTRAP_FRAME, Tf.Dr2)},