Beispiel #1
0
static void     CallMenuItem( a_window *wnd, gui_ctl_id id, int row, int piece )
{
    call_chain  *chain;
    call_window *call = WndCall( wnd );

    piece=piece;

    chain = GetCallChain( &call->tb, row );
    switch( id ) {
    case MENU_INITIALIZE:
        if( chain == NULL ) {
            WndMenuGrayAll( wnd );
        } else {
            WndMenuEnableAll( wnd );
            WndMenuEnable( wnd, MENU_CALL_EXECUTE_TO_RETURN, ( row != 0 ) );
            WndMenuEnable( wnd, MENU_CALL_SOURCE, ( chain->source_line != NULL ) );
        }
        break;
    case MENU_CALL_BREAK:
        DlgBreak( row == 0 ? chain->lc.execution : FindNextIns( chain->lc.execution ) );
        break;
    case MENU_CALL_SOURCE:
        WndSrcInspect( chain->lc.execution );
        break;
    case MENU_CALL_UNWIND:
        UnWindToFrame( chain, row, CallNumRows( wnd ) );
        break;
    case MENU_CALL_ASSEMBLY:
        WndAsmInspect( chain->lc.execution );
        break;
    case MENU_CALL_EXECUTE_TO_RETURN:
        GoToAddr( FindNextIns( chain->lc.execution ) );
        break;
    }
}
Beispiel #2
0
static void RepMenuItem( a_window *wnd, gui_ctl_id id, int row, int piece )
{
    event_record        *ev;

    ev = RepGetEvent( row );
    wnd=wnd;piece=piece;
    switch( id ) {
    case MENU_INITIALIZE:
        WndMenuGrayAll( wnd );
        if( ev != NULL ) {
            WndMenuEnable( wnd, MENU_REPLAY_GOTO, true );
            if( !IS_NIL_ADDR( ev->ip ) ) {
                WndMenuEnable( wnd, MENU_REPLAY_SOURCE, true );
                WndMenuEnable( wnd, MENU_REPLAY_ASSEMBLY, true );
            }
        }
        break;
    case MENU_REPLAY_SOURCE:
        WndSrcInspect( ev->ip );
        break;
    case MENU_REPLAY_ASSEMBLY:
        WndAsmInspect( ev->ip );
        break;
    case MENU_REPLAY_GOTO:
        ReplayTo( ev );
        break;
    }
}
Beispiel #3
0
static void     FuncMenuItem( a_window *wnd, gui_ctl_id id, int row, int piece )
{
    address     addr;
    func_window *func = WndFunc( wnd );

    piece=piece;
    addr = ( row == WND_NO_ROW ) ? NilAddr : NameListAddr( NameList( func ), row );
    switch( id ) {
    case MENU_INITIALIZE:
        if( IS_NIL_ADDR( addr ) ) {
            WndMenuGrayAll( wnd );
        } else {
            WndMenuEnableAll( wnd );
            WndMenuEnable( wnd, MENU_FUNCTIONS_SOURCE, HasLineInfo( addr ) );
        }
        WndMenuEnable( wnd, MENU_FUNCTIONS_D2_ONLY, TRUE );
        WndMenuCheck( wnd, MENU_FUNCTIONS_D2_ONLY, func->d2_only );
        break;
    case MENU_FUNCTIONS_SOURCE:
        WndSrcInspect( addr );
        break;
    case MENU_FUNCTIONS_ASSEMBLY:
        WndAsmInspect( addr );
        break;
    case MENU_FUNCTIONS_BREAK:
        DlgBreak( addr );
        break;
    case MENU_FUNCTIONS_D2_ONLY:
        func->d2_only = !func->d2_only;
        FuncNewOptions( wnd );
        break;
    }
}
Beispiel #4
0
static void     BrkModify( a_window *wnd, int row, int piece )
{
    brkp        *bp;

    if( row < 0 ) {
        BrkMenuItem( wnd, MENU_BREAK_CREATE_NEW, row, piece );
        return;
    }
    bp = BrkGetBP( row );
    if( bp == NULL )
        return;
    if( piece == PIECE_ACTIVE ) {
        WndRowDirty( wnd, row );
        WndBreak( wnd )->toggled_break = true;
        ActPoint( bp, !bp->status.b.active );
#ifdef OPENER_GADGET
    } else if( piece == PIECE_OPENER ) {
        if( bp->size == 0 ) {
            if( bp->source_line != NULL ) {
                WndSrcInspect( bp->loc.addr );
            } else {
                WndAsmInspect( bp->loc.addr );
            }
        }
#endif
    } else {
        WndFirstMenuItem( wnd, row, piece );
    }
}
Beispiel #5
0
static void     ModMenuItem( a_window *wnd, unsigned id, int row, int piece )
{
    address     addr;
    mod_handle  handle;
    mod_window  *mod = WndMod( wnd );

    piece=piece;

    handle = NO_MOD;
    addr = NilAddr;
    if( ModListNumRows( ModList( mod ) ) != 0 && row >= 0 ) {
        handle =  ModListMod( ModList( mod ), row );
        if( handle != NO_MOD ) {
            addr = ModFirstAddr( handle );
        }
    }
    switch( id ) {
    case MENU_INITIALIZE:
        WndMenuGrayAll( wnd );
        if( handle != NO_MOD ) {
            WndMenuEnable( wnd, MENU_MODULES_BREAK_SET_ALL, TRUE );
            WndMenuEnable( wnd, MENU_MODULES_BREAK_CLEAR_ALL, TRUE );
            WndMenuEnable( wnd, MENU_MODULES_ASSEMBLY, !IS_NIL_ADDR( addr ) );
            WndMenuEnable( wnd, MENU_MODULES_FUNCTIONS, TRUE );
            if( ModHasSourceInfo( handle ) ) {
                WndMenuEnable( wnd, MENU_MODULES_SOURCE, TRUE );
            }
        }
        WndMenuEnable( wnd, MENU_MODULES_SHOW_ALL, TRUE );
        WndMenuCheck( wnd, MENU_MODULES_SHOW_ALL, mod->all_modules );
        break;
    case MENU_MODULES_BREAK_SET_ALL:
        BreakAllModEntries( handle );
        break;
    case MENU_MODULES_BREAK_CLEAR_ALL:
        ClearAllModBreaks( handle );
        break;
    case MENU_MODULES_SOURCE:
        if( IS_NIL_ADDR( addr ) ) {
            ModName( handle, TxtBuff, TXT_LEN );
            WndFileInspect( TxtBuff, FALSE );
        } else {
            WndSrcInspect( addr );
        }
        break;
    case MENU_MODULES_ASSEMBLY:
        WndAsmInspect( addr );
        break;
    case MENU_MODULES_FUNCTIONS:
        WndFuncInspect( handle );
        break;
    case MENU_MODULES_SHOW_ALL:
        mod->all_modules = !mod->all_modules;
        ModInit( wnd );
        break;
    }
}
Beispiel #6
0
void SrcExam( void )
{
    address     addr;
//    bool        prompt;

    addr = GetCodeDot();
    OptMemAddr( EXPR_CODE, &addr );
//    prompt = true;
    ReqEOC();
    WndSrcInspect( addr );
}
Beispiel #7
0
static void     BrkMenuItem( a_window *wnd, gui_ctl_id id, int row, int piece )
{
    brkp        *bp;

    piece=piece;
    if( row < 0 ) {
        bp = NULL;
    } else {
        bp = BrkGetBP( row );
    }
    switch( id ) {
    case MENU_INITIALIZE:
        if( bp != NULL ) {
            WndMenuEnableAll( wnd );
            WndMenuEnable( wnd, MENU_BREAK_ENABLE, !bp->status.b.active );
            WndMenuEnable( wnd, MENU_BREAK_DISABLE, bp->status.b.active );
            WndMenuEnable( wnd, MENU_BREAK_SOURCE, bp != NULL && IS_BP_EXECUTE( bp->th ) );
            WndMenuEnable( wnd, MENU_BREAK_ASSEMBLY, bp != NULL && IS_BP_EXECUTE( bp->th ) );
        } else {
            WndMenuGrayAll( wnd );
        }
        WndMenuEnable( wnd, MENU_BREAK_CREATE_NEW, true );
        break;
    case MENU_BREAK_ENABLE:
        ActPoint( bp, true );
        break;
    case MENU_BREAK_DISABLE:
        ActPoint( bp, false );
        break;
    case MENU_BREAK_CREATE_NEW:
        if( DlgBreak( NilAddr ) )
            WndScrollBottom( wnd );
        break;
    case MENU_BREAK_CLEAR:
        RemoveBreak( bp->loc.addr );
        break;
    case MENU_BREAK_MODIFY:
        DlgBreak( bp->loc.addr );
        break;
    case MENU_BREAK_SOURCE:
        WndSrcInspect( bp->loc.addr );
        break;
    case MENU_BREAK_ASSEMBLY:
        WndAsmInspect( bp->loc.addr );
        break;
    }
}
Beispiel #8
0
static void     FileMenuItem( a_window *wnd, gui_ctl_id id, int row, int piece )
{
    address     addr;
    mod_handle  mod;
    bool        has_addr;
    bool        has_popitem;
    file_window *file = WndFile( wnd );

    piece=piece;
    addr = GetRowAddr( file, row, id != MENU_FILE_ASSEMBLY );
    has_addr = !IS_NIL_ADDR( addr );
    switch( id ) {
    case MENU_INITIALIZE:
        has_popitem = ( *WndPopItem( wnd ) != NULLCHAR );
        if( has_popitem && !ScanSelectedExpr( WndPopItem( wnd ) ) ) {
            has_popitem = false;
        }
        WndMenuEnable( wnd, MENU_FILE_SHOW, true );
        WndMenuEnable( wnd, MENU_FILE_SHOW_ADDRESS, true );
        WndMenuEnable( wnd, MENU_FILE_SHOW_MODULE, true );
        WndMenuEnable( wnd, MENU_FILE_FUNCTIONS, file->mod != NO_MOD );
        WndMenuEnable( wnd, MENU_FILE_HOME, true );
        addr = GetRowAddr( file, row, false );
        WndMenuEnable( wnd, MENU_FILE_ASSEMBLY, !IS_NIL_ADDR( addr ) );
        WndMenuEnable( wnd, MENU_FILE_WATCH, has_popitem );
        WndMenuEnable( wnd, MENU_FILE_INSPECT, has_popitem );
        WndMenuEnable( wnd, MENU_FILE_STEP_INTO, file->mod != NO_MOD && has_popitem );
        WndMenuEnable( wnd, MENU_FILE_BREAK, has_popitem );
        WndMenuEnable( wnd, MENU_FILE_RUN, has_addr );
        WndMenuEnable( wnd, MENU_FILE_SKIP_TO_CURSOR, has_addr );
        break;
    case MENU_FILE_RUN:
        GoToAddr( addr );
        break;
    case MENU_FILE_SKIP_TO_CURSOR:
        SkipToAddr( addr );
        break;
    case MENU_FILE_BREAK:
        BreakOnSelected( WndPopItem( wnd ) );
        break;
    case MENU_FILE_HOME:
        GoHome();
        break;
    case MENU_FILE_SHOW_MODULE:
        mod = file->mod;
        if( DlgModName( LIT_DUI( New_Module ), &mod ) ) {
            WndModInspect( mod );
        }
        break;
    case MENU_FILE_SHOW_ADDRESS:
        if( DlgCodeAddr( LIT_DUI( New_Addr ), &addr ) ) {
            WndSrcInspect( addr );
        }
        break;
    case MENU_FILE_STEP_INTO:
        StepIntoFunction( WndPopItem( wnd ) );
        break;
    case MENU_FILE_INSPECT:
        WndInspect( WndPopItem( wnd ) );
        break;
    case MENU_FILE_WATCH:
        WndVarInspect( WndPopItem( wnd ) );
        break;
    case MENU_FILE_SEARCH:
        WndSaveToHistory( SrchHistory, WndPopItem( wnd ) );
        DbgWndSearch( wnd, false, DlgSearch( wnd, SrchHistory ) );
        break;
    case MENU_FILE_ASSEMBLY:
        AsmWndFind( file->asw, addr, file->track );
        break;
    case MENU_FILE_LINE:
        GotoLine( wnd );
        break;
    case MENU_FILE_FUNCTIONS:
        WndFuncInspect( file->mod );
        break;
    }
}