From 76a41370d0199c99d9857adbb3da3b9a67df5579 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Mon, 30 Mar 2020 00:03:02 +0200 Subject: [PATCH] [NTOS:KD] Move dump of stack trace on crash to debugger Release builds now show again the bugcheck screen, instead of freezing. --- ntoskrnl/kd/kdmain.c | 3 +++ ntoskrnl/ke/bug.c | 9 --------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/ntoskrnl/kd/kdmain.c b/ntoskrnl/kd/kdmain.c index 25a63a1c0cb..5749cc8701d 100644 --- a/ntoskrnl/kd/kdmain.c +++ b/ntoskrnl/kd/kdmain.c @@ -277,6 +277,9 @@ KdpEnterDebuggerException(IN PKTRAP_FRAME TrapFrame, Context, TrapFrame); } + + /* We'll manually dump the stack for the user... */ + KeRosDumpStackFrames(NULL, 0); #endif /* not KDBG */ /* Debugger didn't handle it, please handle! */ diff --git a/ntoskrnl/ke/bug.c b/ntoskrnl/ke/bug.c index 7df5c21ed22..47b1f4b5ca3 100644 --- a/ntoskrnl/ke/bug.c +++ b/ntoskrnl/ke/bug.c @@ -1067,15 +1067,6 @@ KeBugCheckWithTf(IN ULONG BugCheckCode, /* Break in the debugger */ KiBugCheckDebugBreak(DBG_STATUS_BUGCHECK_FIRST); } - else - { - /* - * ROS HACK. - * Ok, so debugging is enabled, but KDBG isn't there. - * We'll manually dump the stack for the user. - */ - KeRosDumpStackFrames(NULL, 0); - } } /* Raise IRQL to HIGH_LEVEL */