mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
fix: L0Debug - allow access only for reported stopped threads
- read/write registers/memory only allowed for threads reported as stopped by events - threads newly stopped, accidentally, that are resumed immediately are not allowed register/memory access Related-To: NEO-7776 Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
93f32f96b1
commit
802848a43f
@@ -389,6 +389,7 @@ struct MockDebugSessionLinux : public L0::DebugSessionLinux {
|
||||
allThreads[threadId] = std::make_unique<EuThread>(threadId);
|
||||
}
|
||||
allThreads[threadId]->stopThread(vmHandle);
|
||||
allThreads[threadId]->reportAsStopped();
|
||||
}
|
||||
|
||||
bool readSystemRoutineIdent(EuThread *thread, uint64_t vmHandle, SIP::sr_ident &srIdent) override {
|
||||
@@ -536,6 +537,7 @@ struct MockTileDebugSessionLinux : TileDebugSessionLinux {
|
||||
allThreads[threadId] = std::make_unique<EuThread>(threadId);
|
||||
}
|
||||
allThreads[threadId]->stopThread(vmHandle);
|
||||
allThreads[threadId]->reportAsStopped();
|
||||
}
|
||||
|
||||
bool writeResumeCommand(const std::vector<EuThread::ThreadId> &threadIds) override {
|
||||
|
||||
@@ -285,11 +285,13 @@ TEST(DebugSessionLinuxTest, GivenDeviceWithSingleSliceWhenCallingAreRequestedThr
|
||||
|
||||
EuThread::ThreadId threadId(0, 0, 0, 0, 0);
|
||||
sessionMock->allThreads[threadId]->stopThread(1u);
|
||||
sessionMock->allThreads[threadId]->reportAsStopped();
|
||||
|
||||
uint32_t subDeviceCount = std::max(1u, neoDevice->getNumSubDevices());
|
||||
for (uint32_t i = 0; i < subDeviceCount; i++) {
|
||||
EuThread::ThreadId threadId(i, 0, 0, 0, 0);
|
||||
sessionMock->allThreads[threadId]->stopThread(1u);
|
||||
sessionMock->allThreads[threadId]->reportAsStopped();
|
||||
}
|
||||
stopped = sessionMock->areRequestedThreadsStopped(thread);
|
||||
EXPECT_TRUE(stopped);
|
||||
@@ -6541,6 +6543,7 @@ struct DebugApiRegistersAccessFixture : public DebugApiLinuxFixture {
|
||||
session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToContextStateSaveAreaBindInfo[vmHandle] = {stateSaveAreaGpuVa, maxDbgSurfaceSize};
|
||||
session->allThreadsStopped = true;
|
||||
session->allThreads[stoppedThreadId]->stopThread(1u);
|
||||
session->allThreads[stoppedThreadId]->reportAsStopped();
|
||||
}
|
||||
|
||||
void tearDown() {
|
||||
|
||||
Reference in New Issue
Block a user