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

Method findPyRuntimeFromElfData

src/pystack/_pystack/process.cpp:1305–1322  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1303}
1304
1305remote_addr_t
1306AbstractProcessManager::findPyRuntimeFromElfData() const
1307{
1308 LOG(INFO) << "Trying to resolve PyInterpreterState from Elf data";
1309 SectionInfo section_info;
1310 if (!getSectionInfo(d_main_map.value().Path(), ".PyRuntime", &section_info)) {
1311 LOG(INFO) << "Failed to resolve PyInterpreterState from Elf data because .PyRuntime section "
1312 "could not be found";
1313 return 0;
1314 }
1315 remote_addr_t load_addr = getLoadPointOfModule(d_analyzer->getDwfl(), d_main_map.value().Path());
1316 if (load_addr == 0) {
1317 LOG(INFO) << "Failed to resolve PyInterpreterState from Elf data because module load point "
1318 "could not be found";
1319 return 0;
1320 }
1321 return load_addr + section_info.corrected_addr;
1322}
1323
1324remote_addr_t
1325AbstractProcessManager::findInterpreterStateFromElfData() const

Callers

nothing calls this directly

Calls 3

LOGClass · 0.85
getSectionInfoFunction · 0.85
getLoadPointOfModuleFunction · 0.85

Tested by

no test coverage detected