** Adding traces to investigate crashes on MSVC_x64 builds **

No idea why the testbots didn't display the trace(), so I use
DbgPrint() instead.
This commit is contained in:
Hermès Bélusca-Maïto 2024-11-21 18:29:06 +01:00
parent 82da1390ec
commit 7ca891df79
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
2 changed files with 21 additions and 3 deletions

View file

@ -98,11 +98,12 @@ START_TEST(KdSystemDebugControl)
? !pKdRefreshDebuggerNotPresent()
: (/*KD_DEBUGGER_ENABLED &&*/ !KD_DEBUGGER_NOT_PRESENT));
trace("Debugger is %s\n", IsDebuggerActive ? "active" : "inactive");
DbgPrint("Debugger is %s\n", IsDebuggerActive ? "active" : "inactive");
/* Unsupported commands */
for (Command = 0; Command <= 6; ++Command)
{
DbgPrint("KdSysDbgControl(%lu)\n", Command);
Status = TestSystemDebugControl((SYSDBG_COMMAND)Command);
if (!IsVistaOrHigher || IsDebuggerActive)
ok_eq_hex_test(Command, Status, STATUS_INVALID_INFO_CLASS);
@ -130,6 +131,7 @@ START_TEST(KdSystemDebugControl)
*/
for (Command = 7; Command <= 20; ++Command)
{
DbgPrint("KdSysDbgControl(%lu)\n", Command);
Status = TestSystemDebugControl((SYSDBG_COMMAND)Command);
if (!IsVistaOrHigher || IsDebuggerActive)
ok_neq_hex_test(Command, Status, STATUS_INVALID_INFO_CLASS); // Status must be != STATUS_INVALID_INFO_CLASS
@ -140,12 +142,14 @@ START_TEST(KdSystemDebugControl)
/* Unsupported commands */
for (Command = 21; Command <= 40; ++Command)
{
DbgPrint("KdSysDbgControl(%lu)\n", Command);
Status = TestSystemDebugControl((SYSDBG_COMMAND)Command);
if (!IsVistaOrHigher || IsDebuggerActive)
ok_eq_hex_test(Command, Status, STATUS_INVALID_INFO_CLASS);
else
ok_eq_hex_test(Command, Status, STATUS_DEBUGGER_INACTIVE);
}
DbgPrint("KdSysDbgControl -- Done\n");
}
/* EOF */

View file

@ -33,7 +33,7 @@ GetNtDdiVersion(VOID)
Status = RtlGetVersion((PRTL_OSVERSIONINFOW)&verInfo);
if (!NT_SUCCESS(Status))
{
trace("RtlGetVersion() returned 0x%08lx\n", Status);
DbgPrint("RtlGetVersion() returned 0x%08lx\n", Status);
return 0;
}
@ -92,7 +92,7 @@ START_TEST(NtSystemDebugControl)
IsDebuggerActive = NT_SUCCESS(Status) && !DebuggerInfo.KernelDebuggerNotPresent;
// DebuggerInfo.KernelDebuggerEnabled; // SharedUserData->KdDebuggerEnabled;
trace("Debugger is %s\n", IsDebuggerActive ? "active" : "inactive");
DbgPrint("Debugger is %s\n", IsDebuggerActive ? "active" : "inactive");
/*
* Explicitly disable the debug privilege so that we can test
@ -103,6 +103,7 @@ START_TEST(NtSystemDebugControl)
*/
Status = RtlAdjustPrivilege(SE_DEBUG_PRIVILEGE, FALSE, FALSE, &PrivilegeSet[0]);
ok_eq_hex(Status, STATUS_SUCCESS);
DbgPrint("NtSysDbgControl(%lu)\n", 29);
Status = TestSystemDebugControl(SysDbgGetTriageDump /* 29 */);
ok_eq_hex(Status, STATUS_ACCESS_DENIED);
@ -113,6 +114,7 @@ START_TEST(NtSystemDebugControl)
/* Supported commands */
for (Command = 0; Command <= 5; ++Command)
{
DbgPrint("NtSysDbgControl(%lu)\n", Command);
Status = TestSystemDebugControl((SYSDBG_COMMAND)Command);
if (!IsVistaOrHigher || IsDebuggerActive)
ok_neq_hex_test(Command, Status, STATUS_INVALID_INFO_CLASS);
@ -125,6 +127,7 @@ START_TEST(NtSystemDebugControl)
if (!skip((IsVistaOrHigher && !IsDebuggerActive) || !SharedUserData->KdDebuggerEnabled,
"NtSystemDebugControl(SysDbgBreakPoint) skipped because the debugger is active\n"))
{
DbgPrint("NtSysDbgControl(%lu)\n", 6);
Status = TestSystemDebugControl(SysDbgBreakPoint /* 6 */);
if (!SharedUserData->KdDebuggerEnabled /*&& (!IsVistaOrHigher || IsDebuggerActive)*/)
{
@ -160,6 +163,7 @@ START_TEST(NtSystemDebugControl)
DBG_UNREFERENCED_PARAMETER(IsNT52SP1OrHigher);
for (Command = 7; Command <= 20; ++Command)
{
DbgPrint("NtSysDbgControl(%lu)\n", Command);
Status = TestSystemDebugControl((SYSDBG_COMMAND)Command);
if (!IsVistaOrHigher || IsDebuggerActive)
ok_eq_hex_test(Command, Status, STATUS_NOT_IMPLEMENTED);
@ -185,6 +189,7 @@ START_TEST(NtSystemDebugControl)
Command = SysDbgDisableKernelDebugger; // 22
else
Command = SysDbgEnableKernelDebugger; // 21
DbgPrint("NtSysDbgControl(%lu)\n", Command);
Status = TestSystemDebugControl((SYSDBG_COMMAND)Command);
if (!IsVistaOrHigher || IsDebuggerActive)
{
@ -214,7 +219,9 @@ START_TEST(NtSystemDebugControl)
Command = SysDbgEnableKernelDebugger; // 21
else
Command = SysDbgDisableKernelDebugger; // 22
DbgPrint("NtSysDbgControl(%lu)\n", Command);
Status = TestSystemDebugControl((SYSDBG_COMMAND)Command);
DbgPrint("post - NtSysDbgControl(%lu)\n", Command);
if (!IsVistaOrHigher || IsDebuggerActive)
ok_eq_hex_test(Command, Status, STATUS_SUCCESS);
else
@ -224,6 +231,7 @@ START_TEST(NtSystemDebugControl)
/* Supported commands */
for (Command = 23; Command <= 31; ++Command)
{
DbgPrint("NtSysDbgControl(%lu)\n", Command);
Status = TestSystemDebugControl((SYSDBG_COMMAND)Command);
if (!IsVistaOrHigher || IsDebuggerActive)
ok_neq_hex_test(Command, Status, STATUS_INVALID_INFO_CLASS);
@ -234,6 +242,7 @@ START_TEST(NtSystemDebugControl)
/* These are Vista+ and depend on the OS version */
for (Command = 32; Command <= 36; ++Command)
{
DbgPrint("NtSysDbgControl(%lu)\n", Command);
Status = TestSystemDebugControl((SYSDBG_COMMAND)Command);
if (!IsVistaOrHigher || IsDebuggerActive)
{
@ -249,6 +258,7 @@ START_TEST(NtSystemDebugControl)
}
Command = 37; // SysDbgGetLiveKernelDump
DbgPrint("NtSysDbgControl(%lu)\n", Command);
Status = TestSystemDebugControl((SYSDBG_COMMAND)Command);
if (!IsVistaOrHigher || IsDebuggerActive)
{
@ -263,6 +273,7 @@ START_TEST(NtSystemDebugControl)
}
Command = 38; // SysDbgKdPullRemoteFile
DbgPrint("NtSysDbgControl(%lu)\n", Command);
Status = TestSystemDebugControl((SYSDBG_COMMAND)Command);
if (!IsVistaOrHigher || IsDebuggerActive)
{
@ -279,6 +290,7 @@ START_TEST(NtSystemDebugControl)
/* Unsupported commands */
for (Command = 39; Command <= 40; ++Command)
{
DbgPrint("NtSysDbgControl(%lu)\n", Command);
Status = TestSystemDebugControl((SYSDBG_COMMAND)Command);
if (!IsVistaOrHigher || IsDebuggerActive)
ok_eq_hex_test(Command, Status, STATUS_INVALID_INFO_CLASS);
@ -286,6 +298,8 @@ START_TEST(NtSystemDebugControl)
ok_eq_hex_test(Command, Status, STATUS_DEBUGGER_INACTIVE);
}
DbgPrint("NtSysDbgControl -- Done\n");
/* Finally restore the original debug privilege state */
RtlAdjustPrivilege(SE_DEBUG_PRIVILEGE, PrivilegeSet[0], FALSE, &PrivilegeSet[0]);
}