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

Method findInterpreterStateFromPyRuntime

src/pystack/_pystack/process.cpp:356–373  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

354}
355
356remote_addr_t
357AbstractProcessManager::findInterpreterStateFromPyRuntime(remote_addr_t runtime_addr) const
358{
359 LOG(INFO) << "Searching for PyInterpreterState based on PyRuntime address " << std::hex
360 << std::showbase << runtime_addr;
361
362 Structure<py_runtime_v> py_runtime(shared_from_this(), runtime_addr);
363 remote_addr_t interp_state = py_runtime.getField(&py_runtime_v::o_interp_head);
364
365 if (!isValidInterpreterState(interp_state)) {
366 LOG(INFO) << "Failing to resolve PyInterpreterState based on PyRuntime address " << std::hex
367 << std::showbase << runtime_addr;
368 return (remote_addr_t)NULL;
369 }
370
371 LOG(DEBUG) << "Interpreter head reference from symbol dereference successfully";
372 return interp_state;
373}
374
375remote_addr_t
376AbstractProcessManager::scanMemoryAreaForInterpreterState(const VirtualMap& map) const

Callers

nothing calls this directly

Calls 1

LOGClass · 0.85

Tested by

no test coverage detected