mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
L0 Debugger Windows - implement debugger attach/detach
Related-To: NEO-6718 Signed-off-by: Igor Venevtsev <igor.venevtsev@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
b2021498e2
commit
8c165a6f41
@@ -7,6 +7,8 @@
|
||||
|
||||
#include "shared/test/common/mocks/mock_wddm.h"
|
||||
|
||||
#include "KmEscape.h"
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace NEO {
|
||||
@@ -15,7 +17,33 @@ struct WddmEuDebugInterfaceMock : public WddmMock {
|
||||
WddmEuDebugInterfaceMock(RootDeviceEnvironment &rootDeviceEnvironment) : WddmMock(rootDeviceEnvironment) {}
|
||||
|
||||
bool isDebugAttachAvailable() override {
|
||||
return true;
|
||||
return debugAttachAvailable;
|
||||
}
|
||||
|
||||
NTSTATUS escape(D3DKMT_ESCAPE &escapeCommand) override {
|
||||
auto pEscapeInfo = static_cast<KM_ESCAPE_INFO *>(escapeCommand.pPrivateDriverData);
|
||||
if (pEscapeInfo->EscapeOperation != KM_ESCAPE_EUDBG_L0_DBGUMD_HANDLER) {
|
||||
return escapeStatus;
|
||||
}
|
||||
|
||||
++dbgUmdEscapeActionCalled[pEscapeInfo->KmEuDbgL0EscapeInfo.EscapeActionType];
|
||||
|
||||
switch (pEscapeInfo->KmEuDbgL0EscapeInfo.EscapeActionType) {
|
||||
case DBGUMD_ACTION_ATTACH_DEBUGGER: {
|
||||
pEscapeInfo->KmEuDbgL0EscapeInfo.EscapeReturnStatus = DBGUMD_ACTION_ESCAPE_SUCCESS;
|
||||
pEscapeInfo->KmEuDbgL0EscapeInfo.AttachDebuggerParams.hDebugHandle = debugHandle;
|
||||
break;
|
||||
}
|
||||
case DBGUMD_ACTION_DETACH_DEBUGGER:
|
||||
break;
|
||||
}
|
||||
return escapeStatus;
|
||||
};
|
||||
|
||||
bool debugAttachAvailable = true;
|
||||
NTSTATUS escapeStatus = STATUS_SUCCESS;
|
||||
uint64_t debugHandle = 0x0DEB0DEB;
|
||||
uint32_t dbgUmdEscapeActionCalled[DBGUMD_ACTION_MAX] = {0};
|
||||
};
|
||||
|
||||
} // namespace NEO
|
||||
@@ -75,6 +75,11 @@ TEST_F(WddmTests, whenCheckedIfResourcesCleanupCanBeSkippedThenReturnsFalse) {
|
||||
EXPECT_TRUE(wddm->isDriverAvaliable());
|
||||
}
|
||||
|
||||
TEST_F(WddmTests, whenCheckedIfDebugAttachAvailableThenReturnsFalse) {
|
||||
init();
|
||||
EXPECT_FALSE(wddm->isDebugAttachAvailable());
|
||||
}
|
||||
|
||||
TEST_F(WddmTests, whenCreatingContextWithPowerHintSuccessIsReturned) {
|
||||
init();
|
||||
auto newContext = osContext.get();
|
||||
|
||||
Reference in New Issue
Block a user