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) override; 29 30 Status Launch() override; 31 32 Status Resume() override; 33 34 bool ShouldStop() override; 35 36 Status Stop() override; 37 38 llvm::Optional<MemoryRegionInfo> 39 GetMemoryRegionContainingAddress(lldb::addr_t address, 40 Status &error) override; 41 42 StructuredData::DictionarySP GetThreadsInfo() override; 43 44 StructuredData::DictionarySP GetThreadWithID(lldb::tid_t tid) override; 45 46 StructuredData::DictionarySP GetRegistersForThread(lldb::tid_t tid) override; 47 48 lldb::DataExtractorSP ReadMemoryAtAddress(lldb::addr_t address, size_t size, 49 Status &error) override; 50 51 StructuredData::DictionarySP GetLoadedImages() override; 52 53 lldb::pid_t GetProcessID() override; 54 55 bool IsAlive() override; 56 57 llvm::Optional<std::string> GetScriptedThreadPluginName() override; 58 59 private: 60 lldb::ScriptedThreadInterfaceSP CreateScriptedThreadInterface() override; 61 }; 62 } // namespace lldb_private 63 64 #endif // LLDB_ENABLE_PYTHON 65 #endif // LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTEDPROCESSPYTHONINTERFACE_H 66