[mlir] Update Ch-2.md (#121379)
[llvm-project.git] / lldb / source / Plugins / ScriptInterpreter / Python / Interfaces / ScriptedStopHookPythonInterface.h
blob7f88098cb7fc70f320dd83e1293aff5e5827acd3
1 //===-- ScriptedStopHookPythonInterface.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 //===----------------------------------------------------------------------===//
9 #ifndef LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDSTOPHOOKPYTHONINTERFACE_H
10 #define LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDSTOPHOOKPYTHONINTERFACE_H
12 #include "lldb/Host/Config.h"
13 #include "lldb/Interpreter/Interfaces/ScriptedStopHookInterface.h"
15 #if LLDB_ENABLE_PYTHON
17 #include "ScriptedPythonInterface.h"
19 namespace lldb_private {
20 class ScriptedStopHookPythonInterface : public ScriptedStopHookInterface,
21 public ScriptedPythonInterface,
22 public PluginInterface {
23 public:
24 ScriptedStopHookPythonInterface(ScriptInterpreterPythonImpl &interpreter);
26 llvm::Expected<StructuredData::GenericSP>
27 CreatePluginObject(llvm::StringRef class_name, lldb::TargetSP target_sp,
28 const StructuredDataImpl &args_sp) override;
30 llvm::SmallVector<AbstractMethodRequirement>
31 GetAbstractMethodRequirements() const override {
32 return llvm::SmallVector<AbstractMethodRequirement>({{"handle_stop", 2}});
35 llvm::Expected<bool> HandleStop(ExecutionContext &exe_ctx,
36 lldb::StreamSP &output_sp) override;
38 static void Initialize();
40 static void Terminate();
42 static llvm::StringRef GetPluginNameStatic() {
43 return "ScriptedStopHookPythonInterface";
46 llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
48 } // namespace lldb_private
50 #endif // LLDB_ENABLE_PYTHON
51 #endif // LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDSTOPHOOKPYTHONINTERFACE_H