KdpTrap

UINT8 __stdcall KdpTrap(
        _KTRAP_FRAME *TrapFrame,
        _KEXCEPTION_FRAME *ExceptionFrame,
        _EXCEPTION_RECORD *ExceptionRecord,
        _CONTEXT *ContextRecord,
        CHAR PreviousMode,
        UINT8 SecondChance){
  UINT8 v6; 
  bool v8; 
  unsigned __int64 v9; 
  unsigned __int64 Rip; 
  int v11; 
  int v12; 
  int v13; 
  int v14; 
  int v15; 
  unsigned __int64 v16; 
  CHAR ContextRecorda; 
  UINT8 Completion; 
  v6 = 0;
  v8 = ExceptionRecord->ExceptionCode == -2147483645;
  Completion = 0;
  if( !v8 )
    return KdpReport(TrapFrame, ExceptionFrame, ExceptionRecord, ContextRecord, ContextRecorda, SecondChance);
  v9 = ExceptionRecord->ExceptionInformation[0];
  if( !v9 )
    return KdpReport(TrapFrame, ExceptionFrame, ExceptionRecord, ContextRecord, ContextRecorda, SecondChance);
  Rip = ContextRecord->Rip;
  if( v9 <= 5 )
  {
    v11 = v9 - 1;
    if( v11 )
    {
      v12 = v11 - 1;
      if( v12 )
      {
        v13 = v12 - 1;
        if( v13 )
        {
          v14 = v13 - 1;
          if( v14 )
          {
            if( v14 != 1 )
              goto LABEL_15;
            KdpCommandString(
              (_STRING *)ContextRecord->Rcx,
              (_STRING *)ContextRecord->Rdx,
              PreviousMode,
              ContextRecord,
              TrapFrame,
              ExceptionFrame);
            goto LABEL_13;
          }
          v6 = 1;
        }
        KdpSymbol(
          (_STRING *)ContextRecord->Rcx,
          (_KD_SYMBOLS_INFO *)ContextRecord->Rdx,
          v6,
          PreviousMode,
          ContextRecord,
          TrapFrame,
          ExceptionFrame);
      }
      else
      {
        ContextRecord->Rax = KdpPrompt(
                               (PSTR)ContextRecord->Rcx,
                               ContextRecord->Rdx,
                               (PSTR)ContextRecord->R8,
                               ContextRecord->R9,
                               PreviousMode,
                               TrapFrame,
                               (KTRAP_FRAME *)ExceptionFrame);
      }
LABEL_13:
      v6 = 1;
      goto LABEL_15;
    }
    v15 = KdpPrint(
            LODWORD(ContextRecord->R8),
            LODWORD(ContextRecord->R9),
            (INT8 *)ContextRecord->Rcx,
            ContextRecord->Rdx,
            PreviousMode,
            TrapFrame,
            (KTRAP_FRAME *)ExceptionFrame,
            &Completion);
    v6 = Completion;
    ContextRecord->Rax = v15;
  }
LABEL_15:
  v16 = ContextRecord->Rip;
  if( v16 == Rip )
    ContextRecord->Rip = v16 + 1;
  return v6;
}

Referenced by:

KdTrap
KdpStub