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; } }
void StepIntoFunction( char *func ) { char *old; address stop; old = ReScan( func ); ReqMemAddr( EXPR_CODE, &stop ); ReScan( old ); GoToAddr( stop ); }
void GoToReturn( void ) { address ra; ra = ReturnAddress(); if( !IS_NIL_ADDR( ra ) ) { GoToAddr( ra ); } else { Error( ERR_NONE, LIT( ERR_NO_RETURN_ADDRESS ) ); } }
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; } }