Beispiel #1
0
void __mriDebugException(void)
{
    int wasWaitingForGdbToConnect = IsWaitingForGdbToConnect();
    int justSingleStepped = Platform_IsSingleStepping();
    
    if (Platform_CommCausedInterrupt() && !Platform_CommHasReceiveData())
    {
        Platform_CommClearInterrupt();
        return;
    }

    Platform_EnteringDebuggerHook();
    blockIfGdbHasNotConnected();
    Platform_EnteringDebugger();
    determineSignalValue();
    
    if (isDebugTrap() && 
        Semihost_IsDebuggeeMakingSemihostCall() && 
        Semihost_HandleSemihostRequest() &&
        !justSingleStepped )
    {
        prepareForDebuggerExit();
        return;
    }
    
    if (!wasWaitingForGdbToConnect)
    {
        Platform_DisplayFaultCauseToGdbConsole();
        Send_T_StopResponse();
    }
    
    GdbCommandHandlingLoop();

    prepareForDebuggerExit();
}
Beispiel #2
0
static int processGdbFileResponseCommands(void)
{
    GdbCommandHandlingLoop();

    if (WasControlCFlagSentFromGdb())
    {
        if (!WasSemihostCallCancelledByGdb())
            FlagSemihostCallAsHandled();

        SetSignalValue(SIGINT);
        return 0;
    }
    else
    {
        FlagSemihostCallAsHandled();
        return 1;
    }
}