| 482 | } |
| 483 | |
| 484 | remote_addr_t |
| 485 | AbstractProcessManager::findDebugOffsetsFromMaps() const |
| 486 | { |
| 487 | LOG(INFO) << "Scanning all writable path-backed maps for _Py_DebugOffsets"; |
| 488 | for (auto& map : d_memory_maps) { |
| 489 | if (map.Flags().find("w") != std::string::npos && !map.Path().empty()) { |
| 490 | LOG(DEBUG) << std::hex << std::showbase << "Attempting to locate _Py_DebugOffsets in map of " |
| 491 | << map.Path() << " starting at " << map.Start() << " and ending at " << map.End(); |
| 492 | LOG(DEBUG) << "Flags: " << map.Flags(); |
| 493 | try { |
| 494 | if (remote_addr_t result = scanMemoryAreaForDebugOffsets(map)) { |
| 495 | return result; |
| 496 | } |
| 497 | } catch (RemoteMemCopyError& ex) { |
| 498 | LOG(INFO) << "Failed to scan map starting at " << map.Start(); |
| 499 | } |
| 500 | } |
| 501 | } |
| 502 | return 0; |
| 503 | } |
| 504 | |
| 505 | ssize_t |
| 506 | AbstractProcessManager::copyMemoryFromProcess(remote_addr_t addr, size_t size, void* destination) const |