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 19 namespace lldb_private { 20 class ScriptedProcessPythonInterface : public ScriptedProcessInterface, 21 public ScriptedPythonInterface { 22 public: 23 ScriptedProcessPythonInterface(ScriptInterpreterPythonImpl &interpreter); 24 25 StructuredData::GenericSP 26 CreatePluginObject(const llvm::StringRef class_name, 27 ExecutionContext &exe_ctx, 28 StructuredData::DictionarySP args_sp, 29 StructuredData::Generic *script_obj = nullptr) override; 30 31 Status Launch() override; 32 33 Status Resume() override; 34 35 bool ShouldStop() override; 36 37 Status Stop() override; 38 39 llvm::Optional<MemoryRegionInfo> 40 GetMemoryRegionContainingAddress(lldb::addr_t address, 41 Status &error) override; 42 43 StructuredData::DictionarySP GetThreadsInfo() override; 44 45 StructuredData::DictionarySP GetThreadWithID(lldb::tid_t tid) override; 46 47 StructuredData::DictionarySP GetRegistersForThread(lldb::tid_t tid) override; 48 49 lldb::DataExtractorSP ReadMemoryAtAddress(lldb::addr_t address, size_t size, 50 Status &error) override; 51 52 StructuredData::ArraySP GetLoadedImages() override; 53 54 lldb::pid_t GetProcessID() override; 55 56 bool IsAlive() override; 57 58 llvm::Optional<std::string> GetScriptedThreadPluginName() override; 59 60 private: 61 lldb::ScriptedThreadInterfaceSP CreateScriptedThreadInterface() override; 62 }; 63 } // namespace lldb_private 64 65 #endif // LLDB_ENABLE_PYTHON 66 #endif // LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTEDPROCESSPYTHONINTERFACE_H 67