refactor(debugger): Move PF exception check into bitmask

Related-to: NEO-8617
Signed-off-by: Brandon Yates <brandon.yates@intel.com>
This commit is contained in:
Brandon Yates
2023-09-27 21:24:34 +00:00
committed by Compute-Runtime-Automation
parent 3a21b3b228
commit 9c56a11c2e
2 changed files with 3 additions and 3 deletions

View File

@@ -802,7 +802,7 @@ void DebugSessionImp::generateEventsAndResumeStoppedThreads() {
}
bool DebugSessionImp::isForceExceptionOrForceExternalHaltOnlyExceptionReason(uint32_t *cr0) {
const uint32_t cr0ExceptionBitmask = 0xFC000000;
const uint32_t cr0ExceptionBitmask = 0xFC010000;
const uint32_t cr0ForcedExcpetionBitmask = 0x44000000;
return (((cr0[1] & cr0ExceptionBitmask) & (~cr0ForcedExcpetionBitmask)) == 0);
@@ -826,7 +826,7 @@ void DebugSessionImp::fillResumeAndStoppedThreadsFromNewlyStopped(std::vector<Eu
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()) {
if (isForceExceptionOrForceExternalHaltOnlyExceptionReason(reg.get())) {
bool threadWasInterrupted = false;
for (auto &request : pendingInterrupts) {

View File

@@ -769,7 +769,7 @@ TEST(DebugSessionTest, givenThreadsStoppedWithPageFaultWhenCallingfillResumeAndS
EuThread::ThreadId thread = {0, 0, 0, 0, 1};
sessionMock->newlyStoppedThreads.push_back(thread);
sessionMock->onlyForceException = true;
sessionMock->onlyForceException = false;
std::vector<EuThread::ThreadId> resumeThreads;
std::vector<EuThread::ThreadId> stoppedThreads;