示例#1
0
static void FileSetDotAddr( a_window *wnd, address addr )
{
    file_window *file = WndFile( wnd );

    if( AddrComp( file->dotaddr, addr ) == 0 ) return;
    file->dotaddr = addr;
    if( IS_NIL_ADDR( addr ) ) return;
    if( wnd == WndFindActive() ) {
        AsmMoveDot( file->asw, addr );
        SetCodeDot( addr );
    }
}
示例#2
0
void MakeRunThdCurr( thread_state *thd )
{
    unsigned    err;

    if( !AdvMachState( ACTION_THREAD_CHANGE ) ) return;
    if( RemoteSetRunThreadWithErr( thd->tid, &err ) == 0 ) {
        Error( ERR_NONE, LIT( ERR_NO_MAKE_CURR_THREAD ), thd->tid, err );
    }
    DbgRegs->tid = thd->tid;
    ReadDbgRegs();
    SetCodeDot( GetRegIP() );
    DbgUpdate( UP_REG_CHANGE | UP_CSIP_CHANGE | UP_THREAD_STATE );
}
示例#3
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 );
}
示例#4
0
void MakeThdCurr( thread_state *thd )
{
    error_handle    errh;

    if( !AdvMachState( ACTION_THREAD_CHANGE ) )
        return;
    // NYI - PUI - record the thread change?
    WriteDbgRegs();
    if( RemoteSetThreadWithErr( thd->tid, &errh ) == 0 ) {
        Error( ERR_NONE, LIT_ENG( ERR_NO_MAKE_CURR_THREAD ), thd->tid, errh );
    }
    DbgRegs->tid = thd->tid;
    ReadDbgRegs();
    SetCodeDot( GetRegIP() );
    DbgUpdate( UP_REG_CHANGE | UP_CSIP_CHANGE | UP_THREAD_STATE );
}
示例#5
0
static void AsmSetDotAddr( a_window *wnd, address addr )
{
    mod_handle  mod;
    asm_window  *asw = WndAsm( wnd );

    if( AddrComp( asw->dotaddr, addr ) != 0 ) {
        WndRowDirty( wnd, -TITLE_SIZE );
        asw->dotaddr = addr;
        DeAliasAddrMod( addr, &mod );
        if( mod != asw->mod ) {
            DbgUpdate( UP_OPEN_CHANGE );
            asw->mod = mod;
            AsmSetTitle( wnd );
        }
        if( IS_NIL_ADDR( addr ) ) return;
        if( wnd == WndFindActive() ) {
            SrcMoveDot( asw->src, addr );
            SetCodeDot( addr );
        }
    }
}