Do not assume that a debugger is present only because we are debugging to a file or to the screen. This corrects bugchecks not to launch an INT3 where no debugger is actually there to catch it.

svn path=/trunk/; revision=14046
This commit is contained in:
Alex Ionescu 2005-03-14 04:51:51 +00:00
parent cfdb595cc6
commit e33a78f93b

View file

@ -118,7 +118,7 @@ KdInitSystem(ULONG BootPhase,
if (!_strnicmp(p2, "SCREEN", 6) && BootPhase > 0) if (!_strnicmp(p2, "SCREEN", 6) && BootPhase > 0)
{ {
p2 += 6; p2 += 6;
KdDebuggerEnabled = TRUE; KdDebuggerEnabled = FALSE;
KdDebugState |= KD_DEBUG_SCREEN; KdDebugState |= KD_DEBUG_SCREEN;
} }
else if (!_strnicmp(p2, "BOCHS", 5) && BootPhase == 0) else if (!_strnicmp(p2, "BOCHS", 5) && BootPhase == 0)
@ -150,7 +150,7 @@ KdInitSystem(ULONG BootPhase,
Value = (ULONG)atol(p2); Value = (ULONG)atol(p2);
if (Value > 0 && Value < 5) if (Value > 0 && Value < 5)
{ {
KdDebuggerEnabled = TRUE; KdDebuggerEnabled = FALSE;
KdDebugState |= KD_DEBUG_SERIAL; KdDebugState |= KD_DEBUG_SERIAL;
LogPortInfo.ComPort = Value; LogPortInfo.ComPort = Value;
} }
@ -158,7 +158,7 @@ KdInitSystem(ULONG BootPhase,
else if (!_strnicmp(p2, "FILE", 4) && BootPhase > 0) else if (!_strnicmp(p2, "FILE", 4) && BootPhase > 0)
{ {
p2 += 4; p2 += 4;
KdDebuggerEnabled = TRUE; KdDebuggerEnabled = FALSE;
KdDebugState |= KD_DEBUG_FILELOG; KdDebugState |= KD_DEBUG_FILELOG;
} }
else if (!_strnicmp(p2, "MDA", 3) && BootPhase > 0) else if (!_strnicmp(p2, "MDA", 3) && BootPhase > 0)
@ -247,8 +247,6 @@ KdInitSystem(ULONG BootPhase,
} }
/* Perform any initialization nescessary */ /* Perform any initialization nescessary */
if (KdDebuggerEnabled == TRUE)
{
if (KdDebugState & KD_DEBUG_GDB && BootPhase == 0) if (KdDebugState & KD_DEBUG_GDB && BootPhase == 0)
KdPortInitializeEx(&GdbPortInfo, 0, 0); KdPortInitializeEx(&GdbPortInfo, 0, 0);
@ -261,7 +259,6 @@ KdInitSystem(ULONG BootPhase,
if (KdDebugState & KD_DEBUG_MDA && BootPhase > 0) if (KdDebugState & KD_DEBUG_MDA && BootPhase > 0)
KdInitializeMda(); KdInitializeMda();
} }
}
VOID INIT_FUNCTION VOID INIT_FUNCTION
@ -292,8 +289,6 @@ VOID INIT_FUNCTION
KdInit3(VOID) KdInit3(VOID)
{ {
/* Print some information */ /* Print some information */
if (KdDebuggerEnabled == TRUE)
{
if (KdDebugState & KD_DEBUG_GDB) if (KdDebugState & KD_DEBUG_GDB)
PrintString("\n GDB debugging enabled. COM%ld %ld Baud\n\n", PrintString("\n GDB debugging enabled. COM%ld %ld Baud\n\n",
GdbPortInfo.ComPort, GdbPortInfo.BaudRate); GdbPortInfo.ComPort, GdbPortInfo.BaudRate);
@ -316,7 +311,6 @@ KdInit3(VOID)
if (KdDebugState & KD_DEBUG_MDA) if (KdDebugState & KD_DEBUG_MDA)
PrintString("\n MDA debugging enabled\n\n"); PrintString("\n MDA debugging enabled\n\n");
} }
}
VOID VOID
@ -449,7 +443,7 @@ KdSystemDebugControl(ULONG Code)
/* B - Bug check the system. */ /* B - Bug check the system. */
else if (Code == 1) else if (Code == 1)
{ {
KEBUGCHECK(0xDEADDEAD); KEBUGCHECK(MANUALLY_INITIATED_CRASH);
} }
/* /*
* C - Dump statistics about the distribution of tagged blocks in * C - Dump statistics about the distribution of tagged blocks in