brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.2 KiB · 72da0a1 Raw
60 lines · c
1//===-- ScriptedBreakpointPythonInterface.h -----------------------*- C++2//-*-===//3//4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.5// See https://llvm.org/LICENSE.txt for license information.6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception7//8//===----------------------------------------------------------------------===//9 10#ifndef LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDBREAKPOINTPYTHONINTERFACE_H11#define LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDBREAKPOINTPYTHONINTERFACE_H12 13#include "lldb/Host/Config.h"14#include "lldb/Interpreter/Interfaces/ScriptedBreakpointInterface.h"15 16#if LLDB_ENABLE_PYTHON17 18#include "ScriptedPythonInterface.h"19 20namespace lldb_private {21class ScriptedBreakpointPythonInterface : public ScriptedBreakpointInterface,22                                          public ScriptedPythonInterface,23                                          public PluginInterface {24public:25  ScriptedBreakpointPythonInterface(ScriptInterpreterPythonImpl &interpreter);26 27  llvm::Expected<StructuredData::GenericSP>28  CreatePluginObject(llvm::StringRef class_name, lldb::BreakpointSP break_sp,29                     const StructuredDataImpl &args_sp) override;30 31  llvm::SmallVector<AbstractMethodRequirement>32  GetAbstractMethodRequirements() const override {33    return llvm::SmallVector<AbstractMethodRequirement>({{"__callback__", 2}});34  }35 36  bool ResolverCallback(SymbolContext sym_ctx) override;37  lldb::SearchDepth GetDepth() override;38  std::optional<std::string> GetShortHelp() override;39  lldb::BreakpointLocationSP40  WasHit(lldb::StackFrameSP frame_sp,41         lldb::BreakpointLocationSP bp_loc_sp) override;42  virtual std::optional<std::string>43  GetLocationDescription(lldb::BreakpointLocationSP bp_loc_sp,44                         lldb::DescriptionLevel level) override;45 46  static void Initialize();47 48  static void Terminate();49 50  static llvm::StringRef GetPluginNameStatic() {51    return "ScriptedBreakpointPythonInterface";52  }53 54  llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }55};56} // namespace lldb_private57 58#endif // LLDB_ENABLE_PYTHON59#endif // LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDBREAKPOINTPYTHONINTERFACE_H60