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(llvm::StringRef class_name,
31 lldb::StackFrameListSP input_frames,
32 StructuredData::DictionarySP args_sp) override;
33
34 llvm::SmallVector<AbstractMethodRequirement>
36 return llvm::SmallVector<AbstractMethodRequirement>(
37 {{"get_description"}, {"get_frame_at_index"}});
38 }
39
40 std::string GetDescription(llvm::StringRef class_name) override;
41
42 std::optional<uint32_t> GetPriority(llvm::StringRef class_name) override;
43
44 StructuredData::ObjectSP GetFrameAtIndex(uint32_t index) override;
45
46 static void Initialize();
47 static void Terminate();
48
49 static bool CreateInstance(lldb::ScriptLanguage language,
51
52 static llvm::StringRef GetPluginNameStatic() {
53 return "ScriptedFrameProviderPythonInterface";
54 }
55
56 llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
57};
58} // namespace lldb_private
59
60#endif // LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDFRAMEPROVIDERPYTHONINTERFACE_H
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
llvm::Expected< StructuredData::GenericSP > CreatePluginObject(llvm::StringRef class_name, lldb::StackFrameListSP input_frames, StructuredData::DictionarySP args_sp) 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< Dictionary > DictionarySP
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