Esempio n. 1
0
void LetACADDie()
{
    if( DoneAutoCAD ) {
        DoneAutoCAD = FALSE;
        MyRunProg();    /* we're history! */
    }
}
Esempio n. 2
0
trap_retval ReqProg_kill( void )
{
    prog_kill_ret       *ret;
                                                                          _DBG1(( "AccKillProg" ));
    ret = GetOutPtr( 0 );
    RedirectFini();
    AtEnd = TRUE;
    if( !DoneAutoCAD ) {
        AtEnd = TRUE;
        cputs( "*** Please quit AUTOCAD in order to restart debugger ***\r\n" );
        MyRunProg();
    }
    ret->err = 0;
    return( sizeof( *ret ) );
}
Esempio n. 3
0
static unsigned ProgRun( bool step )
{
    watch       *wp;
    long        trace;
    int         i;
    dword       value;
    prog_go_ret *ret;

                                                                          _DBG1(( "ProgRun" ));
    ret = GetOutPtr( 0 );
    ret->conditions = COND_CONFIG;
    trace = step ? TRACE_BIT : 0;
    Regs.EFL |= trace;
    if( AtEnd ) {
                                                                          _DBG2(("No RunProg"));
        ;
    } else if( !trace && WatchCount != 0 ) {
                                                                          _DBG2(("All that trace goop"));
        if( SetDebugRegs() ) {
            MyRunProg();
            SysRegs.dr6 = 0;
            SysRegs.dr7 = 0;
        } else {
            for( ;; ) {
                Regs.EFL |= TRACE_BIT;
                MyRunProg();
                if( DoneAutoCAD ) break;
                if( IntNum != 1 ) break;
                if( !( SysRegs.dr6 & DR6_BS ) ) break;
                for( wp = WatchPoints, i = WatchCount; i > 0; ++wp, --i ) {
                    ReadMemory( &wp->addr, (void *)&value, 4 );
                    if( value != wp->value ) {
                        ret->conditions |= COND_WATCH;
                        goto leave;
                    }
                }
            }
        }
    } else {
        MyRunProg();
    }
    if( AtEnd ) {
        ret->conditions |= COND_TERMINATE;
    } else if( DoneAutoCAD ) {
        ret->conditions = COND_TERMINATE;
        AtEnd = TRUE;
    } else if( IntNum == 1 ) {
        if( trace ) {
            ret->conditions |= COND_TRACE;
        } else {
            ret->conditions |= COND_WATCH;
        }
    } else if( IntNum == 3 ) {
        ret->conditions |= COND_BREAK;
        Regs.EIP--;
    } else {
        ret->conditions |= COND_EXCEPTION;
    }
leave:
    Regs.EFL &= ~trace;
    ret->program_counter.offset = Regs.EIP;
    ret->program_counter.segment = Regs.CS;
    ret->stack_pointer.offset = Regs.ESP;
    ret->stack_pointer.segment = Regs.SS;
    WatchCount = 0;
    return( sizeof( *ret ) );
}