MCPcopy Create free account
hub / github.com/bloomberg/pystack / pystack_find_elf

Function pystack_find_elf

src/pystack/_pystack/elf_common.cpp:17–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15using file_unique_ptr = std::unique_ptr<FILE, std::function<int(FILE*)>>;
16
17int
18pystack_find_elf(
19 Dwfl_Module* mod,
20 void** userdata,
21 const char* modname,
22 Dwarf_Addr base,
23 char** file_name,
24 Elf** elfp)
25{
26 const char* the_modname = (modname == nullptr) ? "???" : modname;
27 int ret = dwfl_build_id_find_elf(mod, userdata, modname, base, file_name, elfp);
28 if (ret > 0) {
29 const char* the_filename = (*file_name == nullptr) ? "???" : *file_name;
30 LOG(DEBUG) << "Located debug info for " << the_modname << " using BUILD ID in " << the_filename;
31 return ret;
32 }
33 ret = dwfl_linux_proc_find_elf(mod, userdata, modname, base, file_name, elfp);
34 if (file_name == nullptr) {
35 LOG(DEBUG) << "Could not locate debug info for " << the_modname;
36 } else {
37 LOG(DEBUG) << "Located debug info for " << the_modname << " by path in " << *file_name;
38 }
39 return ret;
40}
41
42std::string
43parse_permissions(long flags)

Callers

nothing calls this directly

Calls 1

LOGClass · 0.85

Tested by

no test coverage detected