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_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDFRAMEPROVIDERPYTHONINTERFACE_H
10#define LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDFRAMEPROVIDERPYTHONINTERFACE_H
11
12#include "lldb/Host/Config.h"
13
14#if LLDB_ENABLE_PYTHON
15
19#include <optional>
20
21namespace lldb_private {
22class ScriptedFrameProviderPythonInterface
24 public ScriptedPythonInterface,
25 public PluginInterface {
26public:
27 ScriptedFrameProviderPythonInterface(
28 ScriptInterpreterPythonImpl &interpreter);
29
30 bool AppliesToThread(llvm::StringRef class_name,
31 lldb::ThreadSP thread_sp) override;
32
33 llvm::Expected<StructuredData::GenericSP>
34 CreatePluginObject(llvm::StringRef class_name,
35 lldb::StackFrameListSP input_frames,
36 StructuredData::DictionarySP args_sp) override;
37
38 llvm::SmallVector<AbstractMethodRequirement>
39 GetAbstractMethodRequirements() const override {
40 return llvm::SmallVector<AbstractMethodRequirement>(
41 {{"get_description"}, {"get_frame_at_index"}});
42 }
43
44 std::string GetDescription(llvm::StringRef class_name) override;
45
46 StructuredData::ObjectSP GetFrameAtIndex(uint32_t index) override;
47
48 static void Initialize();
49 static void Terminate();
50
51 static bool CreateInstance(lldb::ScriptLanguage language,
52 ScriptedInterfaceUsages usages);
53
54 static llvm::StringRef GetPluginNameStatic() {
55 return "ScriptedFrameProviderPythonInterface";
56 }
57
58 llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
59};
60} // namespace lldb_private
61
62#endif // LLDB_ENABLE_PYTHON
63#endif // LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDFRAMEPROVIDERPYTHONINTERFACE_H
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