From 08a4791b4ad31fa1eb87d3d6487daefad0d9b69e Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 16 Oct 2014 21:33:32 +0000 Subject: [PATCH] {NTOSKRNL] Handle int 0x2c (assertion failure) in KDBG by breaking into the debugger instead of ignoring it and pretending it was handled. Now NT_ASSERT works on GCC builds as well. (As good as things work in KDBG...) svn path=/trunk/; revision=64770 --- reactos/ntoskrnl/kd/kdmain.c | 7 +----- reactos/ntoskrnl/kdbg/kdb.c | 47 ++++++++++++++++++++---------------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/reactos/ntoskrnl/kd/kdmain.c b/reactos/ntoskrnl/kd/kdmain.c index 769539b0bd8..3c740170729 100644 --- a/reactos/ntoskrnl/kd/kdmain.c +++ b/reactos/ntoskrnl/kd/kdmain.c @@ -189,13 +189,8 @@ KdpEnterDebuggerException(IN PKTRAP_FRAME TrapFrame, /* Check if this is an assertion failure */ if (ExceptionRecord->ExceptionCode == STATUS_ASSERTION_FAILURE) { - /* Warn about it */ - DbgPrint("\n!!! Assertion Failure at Address 0x%p !!!\n\n", - (PVOID)Context->Eip); - - /* Bump EIP to the instruction following the int 2C and return */ + /* Bump EIP to the instruction following the int 2C */ Context->Eip += 2; - return TRUE; } #endif diff --git a/reactos/ntoskrnl/kdbg/kdb.c b/reactos/ntoskrnl/kdbg/kdb.c index 91660cfaf02..17f4c78464d 100644 --- a/reactos/ntoskrnl/kdbg/kdb.c +++ b/reactos/ntoskrnl/kdbg/kdb.c @@ -57,26 +57,27 @@ extern BOOLEAN KdbpBugCheckRequested; 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 */ + { KdbEnterAlways, KdbEnterAlways }, /* 20: Assertion failure */ { KdbDoNotEnter, KdbEnterFromKmode } /* Last entry: used for unknown exceptions */ }; @@ -102,7 +103,8 @@ static const CHAR *ExceptionNrToString[] = "Math Fault", "Alignment Check", "Machine Check", - "SIMD Fault" + "SIMD Fault", + "Assertion Failure" }; ULONG @@ -1320,6 +1322,9 @@ KdbpGetExceptionNumberFromStatus( case STATUS_FLOAT_MULTIPLE_TRAPS: Ret = 18; break; + case STATUS_ASSERTION_FAILURE: + Ret = 20; + break; default: Ret = RTL_NUMBER_OF(KdbEnterConditions) - 1; -- 2.17.1