feature(debugger): online page fault event handling

Related-to: LOCI-2052

Signed-off-by: Brandon Yates <brandon.yates@intel.com>
This commit is contained in:
Brandon Yates
2023-06-16 09:19:16 -04:00
committed by Compute-Runtime-Automation
parent 9db08001c4
commit 0c6444aab7
12 changed files with 486 additions and 61 deletions

View File

@@ -821,7 +821,12 @@ void DebugSessionImp::fillResumeAndStoppedThreadsFromNewlyStopped(std::vector<Eu
memset(reg.get(), 0, regSize);
readRegistersImp(newlyStopped, ZET_DEBUG_REGSET_TYPE_CR_INTEL_GPU, 0, 1, reg.get());
if (isForceExceptionOrForceExternalHaltOnlyExceptionReason(reg.get())) {
if (allThreads[newlyStopped]->getPageFault()) {
const uint32_t cr0PFBit16 = 0x10000;
reg[1] = reg[1] | cr0PFBit16;
writeRegistersImp(newlyStopped, ZET_DEBUG_REGSET_TYPE_CR_INTEL_GPU, 0, 1, reg.get());
}
if (isForceExceptionOrForceExternalHaltOnlyExceptionReason(reg.get()) && !allThreads[newlyStopped]->getPageFault()) {
bool threadWasInterrupted = false;
for (auto &request : pendingInterrupts) {
@@ -845,6 +850,7 @@ void DebugSessionImp::fillResumeAndStoppedThreadsFromNewlyStopped(std::vector<Eu
}
} else {
PRINT_DEBUGGER_THREAD_LOG("Newly stopped thread = %s, exception bits = %#010" PRIx32 "\n", allThreads[newlyStopped]->toString().c_str(), reg[1]);
allThreads[newlyStopped]->setPageFault(false);
stoppedThreadsToReport.push_back(newlyStopped);
}
}