Ejemplo n.º 1
0
unsigned Execute( bool tracing, bool do_flip )
{
    unsigned    conditions;
    bool        stack_cmds;
    static unsigned executing = 0;

    if( !CheckStackPos() )
        return( COND_USER );
    if( !AdvMachState( ACTION_EXECUTE ) )
        return( COND_USER );

    if( executing == 0 ) {
        ++executing;
        HookNotify( true, HOOK_EXEC_START );
        --executing;
    }

    /* get rid of useless pending input information */
    for( ;; ) {
        if( CurrToken != T_LINE_SEPARATOR )
            break;
        if( InpStack == NULL )
            break;
        if( InpStack->type & (INP_HOLD|INP_STOP_PURGE) )
            break;
        if( InpStack->rtn( InpStack->handle, INP_RTN_EOL ) )
            continue;
        PopInpStack();
    }
    _SwitchOff( SW_TRAP_CMDS_PUSHED );
    conditions = ExecProg( tracing, do_flip, true );
    SetCodeDot( GetRegIP() );
    stack_cmds = true;
    if( tracing && (conditions & COND_BREAK) )
        stack_cmds = false;
    if( ReportTrap( conditions, stack_cmds ) ) {
        _SwitchOn( SW_TRAP_CMDS_PUSHED );
    }
    if( executing == 0 ) {
        ++executing;
        HookNotify( true, HOOK_EXEC_END );
        --executing;
    }
    if( conditions & COND_TERMINATE ) {
        HookNotify( true, HOOK_PROG_END );
    }
    return( conditions );
}
Ejemplo n.º 2
0
static bool CallRoutine( void )
{
    unsigned    trap;
    address     sp;

    sp = GetRegSP();
    for( ;; ) {
        trap = ExecProg( FALSE, TRUE, FALSE );
        if( !(trap & COND_BREAK) ) {
            ReportTrap( trap, FALSE );
            return( FALSE );
        }
        if( MADTraceHaveRecursed( sp, &DbgRegs->mr ) != MS_OK ) {
            return( TRUE );
        }
    }
}