static void LoadCueMap( drmem_hdl stmts, address *addr, cue_list *list ) /**********************************************************************/ { la_walk_info wlk; wlk.ret = *addr; wlk.list = list; wlk.curr_seg = NULL; DRWalkLines( stmts, SEG_CODE, ACueAddr, &wlk ); }
dip_status DIGENTRY DIPImpModInfo( imp_image_handle *ii, imp_mod_handle im, handle_kind hk ) { /* Return DS_OK if the module has the kind of information indicated by 'hk', DS_FAIL if it does not. */ dip_status ret; dr_handle stmts; mod_info *modinfo; ret = DS_FAIL; if( im == IMH_NOMOD ) { DCStatus( ret ); return( ret ); } modinfo = IM2MODI( ii, im ); switch( hk ) { case HK_IMAGE: break; case HK_TYPE: if( modinfo->stmts != 0 ) { ret = DS_OK; } break; case HK_CUE: stmts = modinfo->stmts; if( stmts != 0 ) { // need to get rid of stmts for file with no cues l_walk_info walk; address a; walk.ii = ii; walk.im = im; walk.ret = &a; DRSetDebug( ii->dwarf->handle ); /* set dwarf to image */ if( !DRWalkLines( stmts, SEG_CODE, ALineCue, &walk ) ) { ret = DS_OK; } } break; case HK_SYM: /* if no lang assumed linker generated */ if( modinfo->lang != DR_LANG_UNKNOWN ) { ret = DS_OK; } break; default: break; } return( ret ); }
address DIGENTRY DIPImpModAddr( imp_image_handle *ii, imp_mod_handle im ) { l_walk_info walk; address a; dr_handle stmts; if( im != IMH_NOMOD && (stmts = IM2MODI( ii, im )->stmts) != 0 ) { DRSetDebug( ii->dwarf->handle ); /* must do at each call into dwarf */ walk.ii = ii; walk.im = im; walk.ret = &a; if( !DRWalkLines( stmts, SEG_CODE, AModAddr, &walk ) ) { // found return( a ); } } DCStatus( DS_FAIL ); return( NilAddr ); }
static bool FirstCue( drmem_hdl stmts, uint_16 fno, imp_cue_handle *ic ) /**********************************************************************/ { bool cont; first_cue_wlk wlk; wlk.fno = fno; cont = DRWalkLines( stmts, SEG_CODE, TheFirstCue, &wlk ); if( cont == false ) { ic->fno = wlk.first.file; ic->line = wlk.first.line; // ic->col = wlk.first.col; ic->col = 0; ic->a = NilAddr; ic->a.mach.segment = wlk.first.seg; ic->a.mach.offset = wlk.first.offset; } return( cont ); }