From 43ddabd8e695a76121d38a68fd2ec37c3a54a233 Mon Sep 17 00:00:00 2001 From: "Yates, Brandon" Date: Wed, 7 Dec 2022 14:46:59 +0000 Subject: [PATCH] L0 Debug - Change interrupt return code to match linux Signed-off-by: Yates, Brandon --- level_zero/tools/source/debug/windows/debug_session.cpp | 4 ++-- .../sources/debug/windows/test_debug_api_windows.cpp | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/level_zero/tools/source/debug/windows/debug_session.cpp b/level_zero/tools/source/debug/windows/debug_session.cpp index 642db1a7ad..b901a93d10 100644 --- a/level_zero/tools/source/debug/windows/debug_session.cpp +++ b/level_zero/tools/source/debug/windows/debug_session.cpp @@ -580,12 +580,12 @@ ze_result_t DebugSessionWindows::interruptImp(uint32_t deviceIndex) { auto status = runEscape(escapeInfo); if (STATUS_SUCCESS != status) { PRINT_DEBUGGER_ERROR_LOG("DBGUMD_ACTION_EU_CONTROL_INT_ALL: Failed - Status: 0x%llX EscapeReturnStatus: %d\n", status, escapeInfo.KmEuDbgL0EscapeInfo.EscapeReturnStatus); - return DebugSessionWindows::translateNtStatusToZeResult(status); + return ZE_RESULT_ERROR_NOT_AVAILABLE; } if (DBGUMD_RETURN_ESCAPE_SUCCESS != escapeInfo.KmEuDbgL0EscapeInfo.EscapeReturnStatus) { PRINT_DEBUGGER_ERROR_LOG("DBGUMD_ACTION_EU_CONTROL_INT_ALL: Failed - Status: 0x%llX EscapeReturnStatus: %d\n", status, escapeInfo.KmEuDbgL0EscapeInfo.EscapeReturnStatus); - return DebugSessionWindows::translateEscapeReturnStatusToZeResult(escapeInfo.KmEuDbgL0EscapeInfo.EscapeReturnStatus); + return ZE_RESULT_ERROR_NOT_AVAILABLE; } PRINT_DEBUGGER_INFO_LOG("DBGUMD_ACTION_EU_CONTROL_INT_ALL - Success\n"); diff --git a/level_zero/tools/test/unit_tests/sources/debug/windows/test_debug_api_windows.cpp b/level_zero/tools/test/unit_tests/sources/debug/windows/test_debug_api_windows.cpp index 33aebe8ac4..7b60ef74a8 100644 --- a/level_zero/tools/test/unit_tests/sources/debug/windows/test_debug_api_windows.cpp +++ b/level_zero/tools/test/unit_tests/sources/debug/windows/test_debug_api_windows.cpp @@ -1794,13 +1794,17 @@ TEST_F(DebugApiWindowsTest, GivenErrorCasesWhenInterruptImpIsCalledThenErrorIsRe session->debugHandle = MockDebugSessionWindows::mockDebugHandle; mockWddm->ntStatus = STATUS_WAIT_1; - EXPECT_EQ(ZE_RESULT_ERROR_UNKNOWN, session->interruptImp(0)); + EXPECT_EQ(ZE_RESULT_ERROR_NOT_AVAILABLE, session->interruptImp(0)); EXPECT_EQ(1u, mockWddm->dbgUmdEscapeActionCalled[DBGUMD_ACTION_EU_CONTROL_INT_ALL]); mockWddm->ntStatus = STATUS_SUCCESS; mockWddm->escapeReturnStatus = DBGUMD_RETURN_DEBUGGER_ATTACH_DEVICE_BUSY; EXPECT_EQ(ZE_RESULT_ERROR_NOT_AVAILABLE, session->interruptImp(0)); EXPECT_EQ(2u, mockWddm->dbgUmdEscapeActionCalled[DBGUMD_ACTION_EU_CONTROL_INT_ALL]); + + mockWddm->escapeReturnStatus = DBGUMD_RETURN_KMD_DEBUG_ERROR; + EXPECT_EQ(ZE_RESULT_ERROR_NOT_AVAILABLE, session->interruptImp(0)); + EXPECT_EQ(3u, mockWddm->dbgUmdEscapeActionCalled[DBGUMD_ACTION_EU_CONTROL_INT_ALL]); } TEST_F(DebugApiWindowsTest, GivenInterruptImpSucceededThenSuccessIsReturned) {