void BPsUnHit( void ) { brkp *bp; for( bp = BrkList; bp != NULL; bp = bp->next ) { bp->status.b.hit = false; } NullStatus( &UserTmpBrk ); NullStatus( &DbgTmpBrk ); }
void BPsDeac( void ) { brkp *bp; for( bp = BrkList; bp != NULL; bp = bp->next ) { DoActPoint( bp, false ); } DbgUpdate( UP_BREAK_CHANGE ); NullStatus( &UserTmpBrk ); NullStatus( &DbgTmpBrk ); }
void GoToAddr( address addr ) { if( IS_NIL_ADDR( addr ) ) return; SetTempBreak( addr ); Go( TRUE ); NullStatus( &UserTmpBrk ); }
static void SetTempBreak( address addr ) { NullStatus( &UserTmpBrk ); UserTmpBrk.status.b.has_address = TRUE; UserTmpBrk.status.b.active = TRUE; UserTmpBrk.loc.addr = addr; }
bool PerformExplicitCall( address start, mad_string ctype, unsigned num_parms ) { bool ret; stack_entry *src; address stack; unsigned align; unsigned long amount; mad_type_info mti; stack = GetRegSP(); GetMADTypeDefaultAt( stack, MTK_INTEGER, &mti ); align = mti.b.bits / BITS_PER_BYTE; for( ; num_parms != 0; --num_parms ) { if( ExprSP->v.loc.e[0].type!=LT_ADDR && ExprSP->v.loc.e[0].u.p==NULL ) { /* push item */ src = StkEntry( 1 ); amount = (src->info.size + (align-1)) & -align; if( _IsOff( SW_STACK_GROWS_UP ) ) { stack.mach.offset -= amount; } LocationCreate( &ExprSP->v.loc, LT_ADDR, &stack ); if( _IsOn( SW_STACK_GROWS_UP ) ) { stack.mach.offset += amount; } ExprSP->info = src->info; ExprSP->flags |= SF_LOCATION; ExprSP->th = NULL; } SwapStack( 1 ); DoAssign(); PopEntry(); } AddrFix( &start ); SetRegSP( stack ); MADCallBuildFrame( ctype, start, start, &DbgRegs->mr, &DbgRegs->mr ); DbgTmpBrk.loc.addr = start; NullStatus( &DbgTmpBrk ); DbgTmpBrk.status.b.active = TRUE; ret = CallRoutine(); NullStatus( &DbgTmpBrk ); return( ret ); }
static brkp *AddPoint( address loc, mad_type_handle th, bool unmapped ) { brkp *bp; brkp **owner; if( !IS_BP_EXECUTE( th ) && !BrkCheckWatchLimit( loc, th ) ) return( NULL ); _Alloc( bp, sizeof( brkp ) ); InitMappableAddr( &bp->loc ); bp->th = th; bp->mad = SysConfig.mad; NullStatus( bp ); bp->status.b.active = true; bp->source_line = NULL; bp->image_name = NULL; bp->mod_name = NULL; bp->sym_name = NULL; bp->cue_diff = 0; bp->status.b.unmapped = unmapped; SetPointAddr( bp, loc ); bp->cmds = NULL; bp->status.b.use_cmds = false; bp->index = FindNextBPIndex(); bp->total_hits = 0; bp->countdown = 0; bp->initial_countdown = 0; bp->status.b.use_countdown = false; bp->condition = NULL; bp->status.b.use_condition = false; bp->error = NULL; owner = &BrkList; while( *owner != NULL ) { owner = &((*owner)->next); } bp->next = NULL; *owner = bp; DbgUpdate( UP_BREAK_CHANGE ); return( bp ); }
void ProcGo( void ) { address start; address stop; bool have_start; bool have_stop; bool have_keep; bool doflip; bool flip_on; bool until; unsigned conditions; int count; have_keep = FALSE; doflip = TRUE; until = FALSE; while( CurrToken == T_DIV ) { Scan(); switch( ScanCmd( GoOptionTab ) ) { case KEEP: have_keep = TRUE; break; case NOFLIP: doflip = FALSE; break; case UNTIL: until = TRUE; break; default: Error( ERR_LOC, LIT( ERR_BAD_OPTION ), GetCmdName( CMD_GO ) ); } } if( !have_keep ) TraceKill(); NullStatus( &DbgTmpBrk ); start = GetRegIP(); have_stop = FALSE; have_start = FALSE; if( !ScanEOC() ) { stop = start; ReqMemAddr( EXPR_GIVEN, &stop ); if( CurrToken == T_COMMA ) { start = stop; have_start = TRUE; Scan(); if( !ScanEOC() ) { ReqMemAddr( EXPR_GIVEN, &stop ); have_stop = TRUE; } } else { have_stop = TRUE; } } ReqEOC(); count = 0; do { if( have_stop ) { if( have_keep ) { if( UserTmpBrk.status.b.has_address ) { NullStatus( &UserTmpBrk ); UserTmpBrk.status.b.has_address = TRUE; } else { NullStatus( &UserTmpBrk ); } Error( ERR_NONE, LIT( ERR_INCONSISTENT_GO ) ); } SetTempBreak( stop ); } else if( have_keep ) { if( UserTmpBrk.status.b.has_address ) { UserTmpBrk.status.b.active = TRUE; } } else { NullStatus( &UserTmpBrk ); } if( have_start ) { RecordSetRegIP( start ); } flip_on = _IsOn( SW_FLIP ); if( !doflip ) { _SwitchOff( SW_FLIP ); } conditions = Go( doflip ); if( flip_on ) _SwitchOn( SW_FLIP ); if( UserTmpBrk.status.b.has_address ) { NullStatus( &UserTmpBrk ); UserTmpBrk.status.b.has_address = TRUE; } else { NullStatus( &UserTmpBrk ); } } while( until && (conditions & COND_BREAK) && AddrComp( stop, GetRegIP() ) != 0 && ++count < 100 ); }
void InitBPs( void ) { NullStatus( &UserTmpBrk ); NullStatus( &DbgTmpBrk ); BrkList = NULL; }