Add /BREAK option.
Enter KDB on bootup only if /BREAK options is given.
(You can also use KDBinit to enter KDB a little later than with /BREAK)
Modified: trunk/reactos/ntoskrnl/ex/init.c
Modified: trunk/reactos/ntoskrnl/include/internal/kd.h
Modified: trunk/reactos/ntoskrnl/kd/kdinit.c
_____
Modified: trunk/reactos/ntoskrnl/ex/init.c
--- trunk/reactos/ntoskrnl/ex/init.c 2005-10-09 00:25:19 UTC (rev
18368)
+++ trunk/reactos/ntoskrnl/ex/init.c 2005-10-09 00:45:33 UTC (rev
18369)
@@ -615,7 +615,7 @@
/* Report all resources used by hal */
HalReportResourceUsage();
-
+
/* Clear the screen to blue */
HalInitSystem(2, (PLOADER_PARAMETER_BLOCK)&KeLoaderBlock);
@@ -635,7 +635,8 @@
ExpInitTimeZoneInfo();
/* Enter the kernel debugger before starting up the boot drivers */
- if (KdDebuggerEnabled) KdbEnter();
+ if (KdDebuggerEnabled && KdpEarlyBreak)
+ DbgBreakPoint();
/* Setup Drivers and Root Device Node */
IoInit2(BootLog);
_____
Modified: trunk/reactos/ntoskrnl/include/internal/kd.h
--- trunk/reactos/ntoskrnl/include/internal/kd.h 2005-10-09
00:25:19 UTC (rev 18368)
+++ trunk/reactos/ntoskrnl/include/internal/kd.h 2005-10-09
00:45:33 UTC (rev 18369)
@@ -280,4 +280,7 @@
/* The KD Native Provider List */
extern LIST_ENTRY KdProviders;
+/* Whether to enter KDB as early as possible or not */
+extern BOOLEAN KdpEarlyBreak;
+
#endif /* __INCLUDE_INTERNAL_KERNEL_DEBUGGER_H */
_____
Modified: trunk/reactos/ntoskrnl/kd/kdinit.c
--- trunk/reactos/ntoskrnl/kd/kdinit.c 2005-10-09 00:25:19 UTC (rev
18368)
+++ trunk/reactos/ntoskrnl/kd/kdinit.c 2005-10-09 00:45:33 UTC (rev
18369)
@@ -27,6 +27,7 @@
PKDP_INIT_ROUTINE WrapperInitRoutine;
KD_DISPATCH_TABLE WrapperTable;
#endif
+BOOLEAN KdpEarlyBreak = FALSE;
LIST_ENTRY KdProviders = {&KdProviders, &KdProviders};
KD_DISPATCH_TABLE DispatchTable[KdMax];
@@ -180,6 +181,12 @@
p2 = KdpGetDebugMode(p2);
p2 = KdpGetWrapperDebugMode(p2, LoaderBlock);
}
+ /* Check for early breakpoint */
+ else if (!_strnicmp(p2, "BREAK", 5))
+ {
+ p2 += 5;
+ KdpEarlyBreak = TRUE;
+ }
/* Check for Kernel Debugging Enable */
else if (!_strnicmp(p2, "DEBUG", 5))
{
Show replies by date