| 543 | } |
| 544 | |
| 545 | bool ElfParser::loadSymbolsFromDebuginfodCache(const char* build_id, const int build_id_len) { |
| 546 | const char* debuginfod_cache = getDebuginfodCache(); |
| 547 | if (debuginfod_cache == NULL || !debuginfod_cache[0]) { |
| 548 | return false; |
| 549 | } |
| 550 | |
| 551 | char path[PATH_MAX]; |
| 552 | const int debuginfod_cache_len = strlen(debuginfod_cache); |
| 553 | if (debuginfod_cache_len + build_id_len + strlen("/debuginfo") >= sizeof(path)) { |
| 554 | Log::warn("Path too long, skipping loading symbols: %s", debuginfod_cache); |
| 555 | return false; |
| 556 | } |
| 557 | |
| 558 | char* p = strcpy(path, debuginfod_cache); |
| 559 | p += debuginfod_cache_len; |
| 560 | for (int i = 0; i < build_id_len; i++) { |
| 561 | p += snprintf(p, 3, "%02hhx", build_id[i]); |
| 562 | } |
| 563 | strcpy(p, "/debuginfo"); |
| 564 | |
| 565 | return parseFile(_cc, _base, path, false); |
| 566 | } |
| 567 | |
| 568 | // Load symbols from the first file that exists in the following locations, in order, where abcdef1234 is Build ID. |
| 569 | // /usr/lib/debug/.build-id/ab/cdef1234.debug |
nothing calls this directly
no outgoing calls
no test coverage detected