static void onLoad( void* ctx, const module_data_t* m, bool loaded ) { dr_printf( "In onLoad(%s, %p-%p)\n", m->full_path, m->start, m->end ); dr_mutex_lock( outMutex ); dr_fprintf( outFile, "M %p %p %s\n", m->start, m->end, m->full_path ); dr_mutex_unlock( outMutex ); drsym_error_t rc = drsym_enumerate_symbols( m->full_path, onSymbol, (void*)m, 0 ); if( DRSYM_SUCCESS != rc ) { dr_printf( " drsym_enumerate_symbols() failed: %i\n", rc ); } }
static void enumerate_symbols(const char *dllpath, const char *match, bool search, bool searchall) { drsym_error_t symres; if (verbose) get_and_print_debug_kind(dllpath); #ifdef WINDOWS if (search) symres = drsym_search_symbols(dllpath, match, searchall, search_cb, NULL); else { #endif symres = drsym_enumerate_symbols(dllpath, search_cb, (void *)match, DRSYM_DEMANGLE); #ifdef WINDOWS } #endif if (symres != DRSYM_SUCCESS && verbose) printf("search/enum error %d\n", symres); }