1 //===-- ScriptedThreadPlanPythonInterface.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_INTERFACES_SCRIPTEDTHREADPLANPYTHONINTERFACE_H 10 #define LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDTHREADPLANPYTHONINTERFACE_H 11 12 #include "lldb/Host/Config.h" 13 #include "lldb/Interpreter/Interfaces/ScriptedThreadPlanInterface.h" 14 15 #if LLDB_ENABLE_PYTHON 16 17 #include "ScriptedPythonInterface.h" 18 19 #include <optional> 20 21 namespace lldb_private { 22 class ScriptedThreadPlanPythonInterface : public ScriptedThreadPlanInterface, 23 public ScriptedPythonInterface, 24 public PluginInterface { 25 public: 26 ScriptedThreadPlanPythonInterface(ScriptInterpreterPythonImpl &interpreter); 27 28 llvm::Expected<StructuredData::GenericSP> 29 CreatePluginObject(const llvm::StringRef class_name, 30 lldb::ThreadPlanSP thread_plan_sp, 31 const StructuredDataImpl &args_sp) override; 32 33 llvm::SmallVector<llvm::StringLiteral> GetAbstractMethods() const override { 34 return {}; 35 } 36 37 llvm::Expected<bool> ExplainsStop(Event *event) override; 38 39 llvm::Expected<bool> ShouldStop(Event *event) override; 40 41 llvm::Expected<bool> IsStale() override; 42 43 lldb::StateType GetRunState() override; 44 45 llvm::Error GetStopDescription(lldb::StreamSP &stream) override; 46 47 static void Initialize(); 48 49 static void Terminate(); 50 51 static llvm::StringRef GetPluginNameStatic() { 52 return "ScriptedThreadPlanPythonInterface"; 53 } 54 55 llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); } 56 }; 57 } // namespace lldb_private 58 59 #endif // LLDB_ENABLE_PYTHON 60 #endif // LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDTHREADPLANPYTHONINTERFACE_H 61