MCPcopy Create free account
hub / github.com/async-profiler/async-profiler / resolveSymbol

Method resolveSymbol

src/profiler.cpp:214–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

212}
213
214const void* Profiler::resolveSymbol(const char* name) {
215 char mangled_name[256];
216 if (strstr(name, "::") != NULL) {
217 mangle(name, mangled_name, sizeof(mangled_name));
218 name = mangled_name;
219 }
220
221 size_t len = strlen(name);
222 int native_lib_count = _native_libs.count();
223 if (len > 0 && name[len - 1] == '*') {
224 for (int i = 0; i < native_lib_count; i++) {
225 const void* address = _native_libs[i]->findSymbolByPrefix(name, len - 1);
226 if (address != NULL) {
227 return address;
228 }
229 }
230 } else {
231 for (int i = 0; i < native_lib_count; i++) {
232 const void* address = _native_libs[i]->findSymbol(name);
233 if (address != NULL) {
234 return address;
235 }
236 }
237 }
238
239 return NULL;
240}
241
242// For BCI_NATIVE_FRAME, library index is encoded ahead of the symbol name
243const char* Profiler::getLibraryName(const char* native_symbol) {

Callers 3

resolveSymbolFunction · 0.80
getBreakpointMethod · 0.80
initMethod · 0.80

Calls 3

findSymbolByPrefixMethod · 0.80
findSymbolMethod · 0.80
countMethod · 0.45

Tested by 1

resolveSymbolFunction · 0.64