/* Periodic callback for GDB. This function is used to catch a ctrl-c or other break in type command from GDB. */
VOID EFIAPI GdbPeriodicCallBack(IN OUT EFI_SYSTEM_CONTEXT SystemContext)
/* Periodic callback for GDB. This function is used to catch a ctrl-c or other break in type command from GDB. */
VOID EFIAPI GdbPeriodicCallBack(IN OUT EFI_SYSTEM_CONTEXT SystemContext)
{
  if (!gCtrlCBreakFlag && !gProcessingFPacket) {
    while (TRUE) {
      if (!GdbIsCharAvailable ()) {
        break;
      }
      if (GdbGetChar () == 0x03) {
        gCtrlCBreakFlag = TRUE;
        break;
      }
    }
  }
  if (gCtrlCBreakFlag) {
    AddSingleStep (SystemContext);
    gCtrlCBreakFlag = FALSE;
  }
}