Source Level Debugger - add MI_LOAD_REG debug cmds

- add 2 MI_LOAD_REGISTER_IMM cmds in preamble when debugger
is active

Change-Id: I4dd46a3c01fc95feadf8a12728ce801efe506e05
This commit is contained in:
Hoppe, Mateusz
2018-04-13 11:50:57 +02:00
committed by sys_ocldev
parent 079f94cd2d
commit 87f0dcda36
5 changed files with 148 additions and 2 deletions

View File

@ -57,3 +57,17 @@ GEN9TEST_F(PreambleTestGen9, givenMidThreadPreemptionAndDisabledDebuggingWhenPre
GEN9TEST_F(PreambleTestGen9, givenDisabledPreemptionAndDisabledDebuggingWhenPreambleSizeIsQueriedThenCorrecrSizeIsReturned) {
SourceLevelDebuggerPreambleTest<FamilyType>::givenDisabledPreemptionAndDisabledDebuggingWhenPreambleSizeIsQueriedThenCorrecrSizeIsReturnedTest();
}
GEN9TEST_F(PreambleTestGen9, givenKernelDebuggingActiveAndDisabledPreemptionWhenGetAdditionalCommandsSizeIsCalledThen2MiLoadRegisterImmCmdsAndStateSipAreInlcuded) {
auto mockDevice = std::unique_ptr<MockDevice>(MockDevice::create<MockDevice>(nullptr));
mockDevice->setSourceLevelDebuggerActive(false);
size_t withoutDebugging = PreambleHelper<FamilyType>::getAdditionalCommandsSize(*mockDevice);
mockDevice->setSourceLevelDebuggerActive(true);
size_t withDebugging = PreambleHelper<FamilyType>::getAdditionalCommandsSize(*mockDevice);
EXPECT_LT(withoutDebugging, withDebugging);
size_t diff = withDebugging - withoutDebugging;
size_t sizeExpected = sizeof(typename FamilyType::STATE_SIP) + 2 * sizeof(typename FamilyType::MI_LOAD_REGISTER_IMM);
EXPECT_EQ(sizeExpected, diff);
}