static KDB_ENTER_CONDITION KdbEnterConditions[][2] =
{
/* First chance Last chance */
- { KdbDoNotEnter, KdbEnterFromKmode }, /* Zero devide */
- { KdbEnterFromKmode, KdbDoNotEnter }, /* Debug trap */
- { KdbDoNotEnter, KdbEnterAlways }, /* NMI */
- { KdbEnterFromKmode, KdbDoNotEnter }, /* INT3 */
- { KdbDoNotEnter, KdbEnterFromKmode }, /* Overflow */
- { KdbDoNotEnter, KdbEnterFromKmode },
- { KdbDoNotEnter, KdbEnterFromKmode }, /* Invalid opcode */
- { KdbDoNotEnter, KdbEnterFromKmode }, /* No math coprocessor fault */
- { KdbEnterAlways, KdbEnterAlways },
- { KdbEnterAlways, KdbEnterAlways },
- { KdbDoNotEnter, KdbEnterFromKmode },
- { KdbDoNotEnter, KdbEnterFromKmode },
- { KdbDoNotEnter, KdbEnterFromKmode }, /* Stack fault */
- { KdbDoNotEnter, KdbEnterFromKmode }, /* General protection fault */
- { KdbDoNotEnter, KdbEnterFromKmode }, /* Page fault */
- { KdbEnterAlways, KdbEnterAlways }, /* Reserved (15) */
- { KdbDoNotEnter, KdbEnterFromKmode }, /* FPU fault */
- { KdbDoNotEnter, KdbEnterFromKmode },
- { KdbDoNotEnter, KdbEnterFromKmode },
- { KdbDoNotEnter, KdbEnterFromKmode }, /* SIMD fault */
+ { KdbDoNotEnter, KdbEnterFromKmode }, /* 0: Zero divide */
+ { KdbEnterFromKmode, KdbDoNotEnter }, /* 1: Debug trap */
+ { KdbDoNotEnter, KdbEnterAlways }, /* 2: NMI */
+ { KdbEnterFromKmode, KdbDoNotEnter }, /* 3: INT3 */
+ { KdbDoNotEnter, KdbEnterFromKmode }, /* 4: Overflow */
+ { KdbDoNotEnter, KdbEnterFromKmode }, /* 5: BOUND range exceeded */
+ { KdbDoNotEnter, KdbEnterFromKmode }, /* 6: Invalid opcode */
+ { KdbDoNotEnter, KdbEnterFromKmode }, /* 7: No math coprocessor fault */
+ { KdbEnterAlways, KdbEnterAlways }, /* 8: Double Fault */
+ { KdbEnterAlways, KdbEnterAlways }, /* 9: Unknown(9) */
+ { KdbDoNotEnter, KdbEnterFromKmode }, /* 10: Invalid TSS */
+ { KdbDoNotEnter, KdbEnterFromKmode }, /* 11: Segment Not Present */
+ { KdbDoNotEnter, KdbEnterFromKmode }, /* 12: Stack fault */
+ { KdbDoNotEnter, KdbEnterFromKmode }, /* 13: General protection fault */
+ { KdbDoNotEnter, KdbEnterFromKmode }, /* 14: Page fault */
+ { KdbEnterAlways, KdbEnterAlways }, /* 15: Reserved (15) */
+ { KdbDoNotEnter, KdbEnterFromKmode }, /* 16: FPU fault */
+ { KdbDoNotEnter, KdbEnterFromKmode }, /* 17: Alignment Check */
+ { KdbDoNotEnter, KdbEnterFromKmode }, /* 18: Machine Check */
+ { KdbDoNotEnter, KdbEnterFromKmode }, /* 19: SIMD fault */
+ { KdbEnterFromKmode, KdbDoNotEnter }, /* 20: Assertion failure */
{ KdbDoNotEnter, KdbEnterFromKmode } /* Last entry: used for unknown exceptions */
};
"Math Fault",
"Alignment Check",
"Machine Check",
- "SIMD Fault"
+ "SIMD Fault",
+ "Assertion Failure"
};
ULONG
* Disables interrupts, releases display ownership, ...
*/
static VOID
-KdbpInternalEnter()
+KdbpInternalEnter(VOID)
{
PETHREAD Thread;
PVOID SavedInitialStack, SavedStackBase, SavedKernelStack;
case STATUS_FLOAT_MULTIPLE_TRAPS:
Ret = 18;
break;
+ case STATUS_ASSERTION_FAILURE:
+ Ret = 20;
+ break;
default:
Ret = RTL_NUMBER_OF(KdbEnterConditions) - 1;
KdbCurrentProcess = PsGetCurrentProcess();
/* Set continue type to kdContinue for single steps and breakpoints */
- if (ExceptionCode == STATUS_SINGLE_STEP || ExceptionCode == STATUS_BREAKPOINT)
+ if (ExceptionCode == STATUS_SINGLE_STEP ||
+ ExceptionCode == STATUS_BREAKPOINT ||
+ ExceptionCode == STATUS_ASSERTION_FAILURE)
+ {
ContinueType = kdContinue;
+ }
/* Check if we should handle the exception. */
/* FIXME - won't get all exceptions here :( */
/* Decrement the entry count */
InterlockedDecrement(&KdbEntryCount);
- /* HACK: Raise back to old IRWL */
+ /* HACK: Raise back to old IRQL */
KeRaiseIrql(OldIrql, &OldIrql);
/* Leave critical section */
KdbpGetCommandLineSettings(
PCHAR p1)
{
- PCHAR p2;
+#define CONST_STR_LEN(x) (sizeof(x)/sizeof(x[0]) - 1)
- while (p1 && (p2 = strchr(p1, ' ')))
+ while (p1 && (p1 = strchr(p1, ' ')))
{
- p2 += 2;
+ /* Skip other spaces */
+ while (*p1 == ' ') ++p1;
- if (!_strnicmp(p2, "KDSERIAL", 8))
+ if (!_strnicmp(p1, "KDSERIAL", CONST_STR_LEN("KDSERIAL")))
{
- p2 += 8;
+ p1 += CONST_STR_LEN("KDSERIAL");
KdbDebugState |= KD_DEBUG_KDSERIAL;
KdpDebugMode.Serial = TRUE;
}
- else if (!_strnicmp(p2, "KDNOECHO", 8))
+ else if (!_strnicmp(p1, "KDNOECHO", CONST_STR_LEN("KDNOECHO")))
{
- p2 += 8;
+ p1 += CONST_STR_LEN("KDNOECHO");
KdbDebugState |= KD_DEBUG_KDNOECHO;
}
- else if (!_strnicmp(p2, "FIRSTCHANCE", 11))
+ else if (!_strnicmp(p1, "FIRSTCHANCE", CONST_STR_LEN("FIRSTCHANCE")))
{
- p2 += 11;
+ p1 += CONST_STR_LEN("FIRSTCHANCE");
KdbpSetEnterCondition(-1, TRUE, KdbEnterAlways);
}
-
- p1 = p2;
}
}