1//===-- ScriptedProcessPythonInterface.h ------------------------*- C++ -*-===// 2// 3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4// See https://llvm.org/LICENSE.txt for license information. 5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6// 7//===----------------------------------------------------------------------===// 8 9#ifndef LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTEDPROCESSPYTHONINTERFACE_H 10#define LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTEDPROCESSPYTHONINTERFACE_H 11 12#include "lldb/Host/Config.h" 13 14#if LLDB_ENABLE_PYTHON 15 16#include "ScriptedPythonInterface.h" 17#include "lldb/Interpreter/ScriptedProcessInterface.h" 18#include <optional> 19 20namespace lldb_private { 21class ScriptedProcessPythonInterface : public ScriptedProcessInterface, 22 public ScriptedPythonInterface { 23public: 24 ScriptedProcessPythonInterface(ScriptInterpreterPythonImpl &interpreter); 25 26 StructuredData::GenericSP 27 CreatePluginObject(const llvm::StringRef class_name, 28 ExecutionContext &exe_ctx, 29 StructuredData::DictionarySP args_sp, 30 StructuredData::Generic *script_obj = nullptr) override; 31 32 Status Launch() override; 33 34 Status Resume() override; 35 36 bool ShouldStop() override; 37 38 Status Stop() override; 39 40 std::optional<MemoryRegionInfo> 41 GetMemoryRegionContainingAddress(lldb::addr_t address, 42 Status &error) override; 43 44 StructuredData::DictionarySP GetThreadsInfo() override; 45 46 StructuredData::DictionarySP GetThreadWithID(lldb::tid_t tid) override; 47 48 StructuredData::DictionarySP GetRegistersForThread(lldb::tid_t tid) override; 49 50 lldb::DataExtractorSP ReadMemoryAtAddress(lldb::addr_t address, size_t size, 51 Status &error) override; 52 53 StructuredData::ArraySP GetLoadedImages() override; 54 55 lldb::pid_t GetProcessID() override; 56 57 bool IsAlive() override; 58 59 std::optional<std::string> GetScriptedThreadPluginName() override; 60 61 StructuredData::DictionarySP GetMetadata() override; 62 63private: 64 lldb::ScriptedThreadInterfaceSP CreateScriptedThreadInterface() override; 65}; 66} // namespace lldb_private 67 68#endif // LLDB_ENABLE_PYTHON 69#endif // LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTEDPROCESSPYTHONINTERFACE_H 70