| 488 | } |
| 489 | |
| 490 | static int |
| 491 | module_callback( |
| 492 | Dwfl_Module* mod, |
| 493 | void** userdata __attribute__((unused)), |
| 494 | const char* name __attribute__((unused)), |
| 495 | Dwarf_Addr starty __attribute__((unused)), |
| 496 | void* arg) |
| 497 | { |
| 498 | auto args = static_cast<std::pair<uintptr_t, const std::string&>*>(arg); |
| 499 | if (args->first != 0) { |
| 500 | return DWARF_CB_OK; |
| 501 | } |
| 502 | |
| 503 | Dwarf_Addr start; |
| 504 | Dwarf_Addr end; |
| 505 | const char* mainfile; |
| 506 | const char* debugfile; |
| 507 | const char* modname = |
| 508 | dwfl_module_info(mod, nullptr, &start, &end, nullptr, nullptr, &mainfile, &debugfile); |
| 509 | if (mainfile != nullptr) { |
| 510 | modname = mainfile; |
| 511 | } else if (debugfile != nullptr) { |
| 512 | modname = debugfile; |
| 513 | } |
| 514 | |
| 515 | if (args->second == modname) { |
| 516 | args->first = start; |
| 517 | return DWARF_CB_ABORT; |
| 518 | } |
| 519 | |
| 520 | return DWARF_CB_OK; |
| 521 | } |
| 522 | |
| 523 | uintptr_t |
| 524 | getLoadPointOfModule(const dwfl_unique_ptr& dwfl, const std::string& mod) |
nothing calls this directly
no outgoing calls
no test coverage detected