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 ); }
bool AddLibInfo( bool already_stopping, bool *force_stop ) { unsigned long module; bool added; bool deleted; image_entry *image; added = false; deleted = false; module = 0; while( (module = RemoteGetLibName( module, TxtBuff, TXT_LEN )) != 0 ) { if( TxtBuff[0] == NULLCHAR ) { deleted = true; for( image = DbgImageList; image != NULL; image = image->link ) { if( image->system_handle == module ) { DUIImageLoaded( image, false, already_stopping, force_stop ); UnLoadImgSymInfo( image, false ); break; } } } else { added = true; image = CreateImage( TxtBuff, NULL ); if( image != NULL ) { image->system_handle = module; if( ReLoadImgSymInfo( image ) ) { InitImageInfo( image ); } DUIImageLoaded( image, true, already_stopping, force_stop ); } } } CheckSegAlias(); if( deleted ) { HookNotify( true, HOOK_DLL_END ); } if( added ) { HookNotify( true, HOOK_DLL_START ); } return( added ); }
void DbgUpdate( update_list flags ) { mod_handle prev_mod; input_stack *inp; UpdateFlags |= flags; if( flags & ( UP_SYM_CHANGE ) ) { BrkAddrRefresh(); } if( flags & (UP_REG_CHANGE|UP_CSIP_CHANGE) ) { InitLC( &Context, TRUE ); } if( flags & UP_NEW_PROGRAM ) { SetStackPos( &Context, 0 ); } if( flags & (UP_SYM_CHANGE+UP_STACKPOS_CHANGE+UP_REG_CHANGE+UP_CSIP_CHANGE+UP_CSIP_JUMPED) ) { SymCompFini(); prev_mod = ContextMod; if( DeAliasAddrMod( Context.execution, &ContextMod ) == SR_NONE ) ContextMod = NO_MOD; if( prev_mod != ContextMod ) { HookNotify( FALSE, HOOK_NEW_MODULE ); } } if( flags & (UP_CODE_ADDR_CHANGE | UP_SYM_CHANGE ) ) { prev_mod = CodeAddrMod; if( DeAliasAddrMod( GetCodeDot(), &CodeAddrMod ) == SR_NONE ) { CodeAddrMod = NO_MOD; } if( prev_mod != CodeAddrMod ) { for( inp = InpStack; inp != NULL; inp = inp->link ) { inp->type |= INP_NEW_LANG; } } } DUIUpdate( flags ); }