Author: sginsberg Date: Thu Nov 6 12:33:56 2008 New Revision: 37227
URL: http://svn.reactos.org/svn/reactos?rev=37227&view=rev Log: - Make Kdbg "bugcheck" command work -- Kdbg isn't re-entrant, so defer the bugcheck and exit the input loop
Modified: trunk/reactos/ntoskrnl/kdbg/kdb.c trunk/reactos/ntoskrnl/kdbg/kdb_cli.c
Modified: trunk/reactos/ntoskrnl/kdbg/kdb.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kdbg/kdb.c?rev=372... ============================================================================== --- trunk/reactos/ntoskrnl/kdbg/kdb.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/kdbg/kdb.c [iso-8859-1] Thu Nov 6 12:33:56 2008 @@ -51,6 +51,7 @@ STATIC KDB_KTRAP_FRAME KdbTrapFrame = { { 0 } }; /* The trapframe which was passed to KdbEnterDebuggerException */ STATIC KDB_KTRAP_FRAME KdbThreadTrapFrame = { { 0 } }; /* The trapframe of the current thread (KdbCurrentThread) */ STATIC KAPC_STATE KdbApcState; +extern BOOLEAN KdbpBugCheckRequested;
/* Array of conditions when to enter KDB */ STATIC KDB_ENTER_CONDITION KdbEnterConditions[][2] = @@ -1601,6 +1602,13 @@ /* Leave critical section */ Ke386RestoreFlags(OldEflags);
+ /* Check if user requested a bugcheck */ + if (KdbpBugCheckRequested) + { + /* Bugcheck the system */ + KeBugCheck(MANUALLY_INITIATED_CRASH); + } + continue_execution: /* Clear debug status */ if (ExceptionCode == STATUS_BREAKPOINT) /* FIXME: Why clear DR6 on INT3? */
Modified: trunk/reactos/ntoskrnl/kdbg/kdb_cli.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kdbg/kdb_cli.c?rev... ============================================================================== --- trunk/reactos/ntoskrnl/kdbg/kdb_cli.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/kdbg/kdb_cli.c [iso-8859-1] Thu Nov 6 12:33:56 2008 @@ -99,6 +99,7 @@ STATIC LONG KdbNumberOfColsTerminal = -1;
PCHAR KdbInitFileBuffer = NULL; /* Buffer where KDBinit file is loaded into during initialization */ +BOOLEAN KdbpBugCheckRequested = FALSE;
STATIC CONST struct { @@ -1689,9 +1690,9 @@ STATIC BOOLEAN KdbpCmdBugCheck(ULONG Argc, PCHAR Argv[]) { - /* Bugcheck the system */ - KeBugCheck(MANUALLY_INITIATED_CRASH); - return TRUE; + /* Set the flag and quit looping */ + KdbpBugCheckRequested = TRUE; + return FALSE; }
/*!\brief Sets or displays a config variables value.