static bool ACueFileNum( void *_fc, dr_line_file *curr ) /******************************************************/ { file_walk_cue *fc = _fc; bool cont; imp_cue_handle *ic; dr_dbg_handle saved; ic = fc->ic; ic->a = NilAddr; ic->im = fc->im; if( FirstCue( fc->stmts, curr->index, ic ) ) { ic->fno = curr->index; ic->line = 1; ic->col = 0; } saved = DRGetDebug(); fc->wr = fc->wk( fc->ii, ic, fc->d ); DRSetDebug( saved ); if( fc->wr == WR_CONTINUE ) { cont = true; } else { cont = false; } return( cont ); }
static int ACueFileNum( void *_fc, dr_line_file *curr ) /*****************************************************/ { file_walk_cue *fc = _fc; int cont; imp_cue_handle *ic; dr_dbg_handle saved; ic = fc->ic; DCFree( curr->name ); ic->a = NilAddr; ic->imx = fc->imx; if( FirstCue( fc->stmts, curr->index, ic ) ) { ic->fno = curr->index; ic->line = 1; ic->col = 0; } saved = DRGetDebug(); fc->wr = fc->wk( fc->ii, ic, fc->d ); DRSetDebug( saved ); if( fc->wr == WR_CONTINUE ) { cont = TRUE; } else { cont = FALSE; } return( cont ); }
static bool AInherit( dr_handle inh, int index, void *_d ) /********************************************************/ { //TODO: Need to track virtual base as not to visit same place twice type_wlk_wlk *d = _d; bool cont; dr_handle btype; dr_handle old_inh; imp_sym_handle *is; dr_dbg_handle saved; walk_result wr; index = index; cont = TRUE; btype = DRGetTypeAT( inh ); btype = DRSkipTypeChain( btype ); /* skip modifiers and typedefs */ if( DRGetVirtuality( inh ) == DR_VIRTUALITY_VIRTUAL ) { if( !AddBase( btype, &d->com.vbase ) ) { return( cont ); } } is = d->is; SetSymHandle( (type_wlk *)d, is ); is->sym = inh; is->sclass = SYM_MEM; // treat inherit like a var saved = DRGetDebug(); wr = d->wk( d->com.ii, SWI_INHERIT_START, is, d->com.d ); DRSetDebug( saved ); if( wr == WR_CONTINUE ) { old_inh = d->com.inh; d->com.inh = inh; DRWalkStruct( btype, StrucWlk, d ); d->com.inh = old_inh; saved = DRGetDebug(); d->wk( d->com.ii, SWI_INHERIT_END, NULL, d->com.d ); DRSetDebug( saved ); if( d->wr != WR_CONTINUE ) { cont = FALSE; } } return( cont ); }
walk_result DIGENTRY DIPImpWalkModList( imp_image_handle *ii, IMP_MOD_WKR *wk, void *d ) { im_idx i; walk_result ret; dr_dbg_handle saved; ret = WR_CONTINUE; for( i = 0; i < ii->mod_count; ++i ) { saved = DRGetDebug(); ret = wk( ii, IMX2IM( i ), d ); DRSetDebug( saved ); if( ret != WR_CONTINUE ) { break; } } return( ret ); }
static bool AEnumMem( dr_handle var, int index, void *_d ) /********************************************************/ { type_wlk_wlk *d = _d; bool cont; imp_sym_handle *is; dr_dbg_handle saved; index = index; cont = TRUE; is = d->is; SetSymHandle( (type_wlk *)d, is ); is->sym = var; saved = DRGetDebug(); d->wr = d->wk( d->com.ii, SWI_SYMBOL, is, d->com.d ); DRSetDebug( saved ); if( d->wr != WR_CONTINUE ) { cont = FALSE; } return( cont ); }
walk_result DFWalkModListSrc( imp_image_handle *ii, bool src, IMP_MOD_WKR wk, void *d ) { im_idx i; walk_result ret; dr_dbg_handle saved; mod_info *modinfo; ret = WR_CONTINUE; modinfo = ii->mod_map; for( i = 0; i < ii->mod_count; ++i ) { if( src == modinfo->has_pubnames ) { saved = DRGetDebug(); ret = wk( ii, IMX2IM( i ), d ); DRSetDebug( saved ); if( ret != WR_CONTINUE ) { break; } } ++modinfo; } return( ret ); }
static bool AType( dr_handle type, void *_typ_wlk, dr_search_context *cont ) /**************************************************************************/ { struct mod_type *typ_wlk = _typ_wlk; bool ret; imp_type_handle *it; dr_dbg_handle saved; cont = cont; ret = TRUE; it = typ_wlk->it; it->im = typ_wlk->im; it->state = DF_NOT; it->type = type; saved = DRGetDebug(); typ_wlk->wr = typ_wlk->wk( typ_wlk->ii, it, typ_wlk->d ); DRSetDebug( saved ); if( typ_wlk->wr != WR_CONTINUE ) { ret = FALSE; } return( ret ); }
static bool AMem( dr_handle var, int index, void *_d ) /****************************************************/ { type_wlk_wlk *d = _d; bool cont; imp_sym_handle *is; dr_dbg_handle saved; cont = TRUE; is = d->is; SetSymHandle( (type_wlk *)d, is ); is->sym = var; switch( index ) { case 0: is->sclass = SYM_MEM; break; case 2: is->sclass = SYM_MEMVAR; // static member break; case 3: if( DRGetVirtuality( var ) == DR_VIRTUALITY_VIRTUAL ) { is->sclass = SYM_VIRTF; // virtual func } else if( !DRIsSymDefined( var ) ) { is->sclass = SYM_MEMF; // memfunc decl } else { is->sclass = SYM_MEMVAR; // inlined defn treat like a var } break; } saved = DRGetDebug(); d->wr = d->wk( d->com.ii, SWI_SYMBOL, is, d->com.d ); DRSetDebug( saved ); if( d->wr != WR_CONTINUE ) { cont = FALSE; } return( cont ); }