| 212 | } |
| 213 | |
| 214 | const 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 |
| 243 | const char* Profiler::getLibraryName(const char* native_symbol) { |