/* SMM profile specific INT 1 (single-step) exception handler. */
VOID EFIAPI DebugExceptionHandler(IN EFI_EXCEPTION_TYPE InterruptType, IN EFI_SYSTEM_CONTEXT SystemContext)
/* SMM profile specific INT 1 (single-step) exception handler. */
VOID EFIAPI DebugExceptionHandler(IN EFI_EXCEPTION_TYPE InterruptType, IN EFI_SYSTEM_CONTEXT SystemContext)
{
  UINTN  CpuIndex;
  UINTN  PFEntry;
  if (!mSmmProfileStart &&
      !HEAP_GUARD_NONSTOP_MODE &&
      !NULL_DETECTION_NONSTOP_MODE)
  {
    return;
  }
  CpuIndex = GetCpuIndex ();
  for (PFEntry = 0; PFEntry < mPFEntryCount[CpuIndex]; PFEntry++) {
    *mLastPFEntryPointer[CpuIndex][PFEntry] = mLastPFEntryValue[CpuIndex][PFEntry];
  }
  mPFEntryCount[CpuIndex] = 0;
  CpuFlushTlb ();
  ClearTrapFlag (SystemContext);
}