| 1332 | } |
| 1333 | |
| 1334 | remote_addr_t |
| 1335 | AbstractProcessManager::findInterpreterStateFromDebugOffsets() const |
| 1336 | { |
| 1337 | if (!d_debug_offsets_addr) { |
| 1338 | LOG(DEBUG) << "Debug offsets were never found"; |
| 1339 | return 0; |
| 1340 | } |
| 1341 | |
| 1342 | LOG(INFO) << "Searching for PyInterpreterState based on PyRuntime address " << std::hex |
| 1343 | << std::showbase << d_debug_offsets_addr |
| 1344 | << " found when searching for 3.13+ debug offsets"; |
| 1345 | |
| 1346 | try { |
| 1347 | Structure<py_runtime_v> runtime(shared_from_this(), d_debug_offsets_addr); |
| 1348 | remote_addr_t interp_state = runtime.getField(&py_runtime_v::o_interp_head); |
| 1349 | LOG(DEBUG) << "Checking interpreter state at " << std::hex << std::showbase << interp_state |
| 1350 | << " found at address " |
| 1351 | << runtime.getFieldRemoteAddress(&py_runtime_v::o_interp_head); |
| 1352 | if (isValidInterpreterState(interp_state)) { |
| 1353 | LOG(DEBUG) << "Interpreter head reference from debug offsets dereferences successfully"; |
| 1354 | return interp_state; |
| 1355 | } |
| 1356 | } catch (...) { |
| 1357 | // Swallow exceptions and fall through to return failure |
| 1358 | } |
| 1359 | LOG(INFO) << "Failed to resolve PyInterpreterState based on PyRuntime address " << std::hex |
| 1360 | << std::showbase << d_debug_offsets_addr; |
| 1361 | return 0; |
| 1362 | } |
| 1363 | |
| 1364 | ProcessManager::ProcessManager( |
| 1365 | pid_t pid, |
nothing calls this directly
no test coverage detected