LLDB mainline
ScriptedFrameProviderPythonInterface.h
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
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_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDFRAMEPROVIDERPYTHONINTERFACE_H
10#define LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDFRAMEPROVIDERPYTHONINTERFACE_H
11
15#include <optional>
16
17namespace lldb_private {
21 public PluginInterface {
22public:
24 ScriptInterpreterPythonImpl &interpreter);
25
26 bool AppliesToThread(llvm::StringRef class_name,
27 lldb::ThreadSP thread_sp) override;
28
29 llvm::Expected<StructuredData::GenericSP>
30 CreatePluginObject(const ScriptedMetadata &scripted_metadata,
31 lldb::StackFrameListSP input_frames) override;
32
33 llvm::SmallVector<AbstractMethodRequirement>
35 return llvm::SmallVector<AbstractMethodRequirement>(
36 {{"get_description"}, {"get_frame_at_index"}});
37 }
38
39 std::string GetDescription(llvm::StringRef class_name) override;
40
41 std::optional<uint32_t> GetPriority(llvm::StringRef class_name) override;
42
43 StructuredData::ObjectSP GetFrameAtIndex(uint32_t index) override;
44
45 static void Initialize();
46 static void Terminate();
47
48 static bool CreateInstance(lldb::ScriptLanguage language,
50
51 static llvm::StringRef GetPluginNameStatic() {
52 return "ScriptedFrameProviderPythonInterface";
53 }
54
55 llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
56};
57} // namespace lldb_private
58
59#endif // LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDFRAMEPROVIDERPYTHONINTERFACE_H
llvm::Expected< StructuredData::GenericSP > CreatePluginObject(const ScriptedMetadata &scripted_metadata, lldb::StackFrameListSP input_frames) override
static bool CreateInstance(lldb::ScriptLanguage language, ScriptedInterfaceUsages usages)
StructuredData::ObjectSP GetFrameAtIndex(uint32_t index) override
ScriptedFrameProviderPythonInterface(ScriptInterpreterPythonImpl &interpreter)
std::optional< uint32_t > GetPriority(llvm::StringRef class_name) override
Get the priority of this frame provider.
llvm::SmallVector< AbstractMethodRequirement > GetAbstractMethodRequirements() const override
bool AppliesToThread(llvm::StringRef class_name, lldb::ThreadSP thread_sp) override
std::string GetDescription(llvm::StringRef class_name) override
Get a description string for the frame provider.
ScriptedPythonInterface(ScriptInterpreterPythonImpl &interpreter)
std::shared_ptr< Object > ObjectSP
A class that represents a running process on the host machine.
ScriptLanguage
Script interpreter types.
std::shared_ptr< lldb_private::Thread > ThreadSP
std::shared_ptr< lldb_private::StackFrameList > StackFrameListSP