LLDB mainline
ScriptedFrameProviderInterface.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_INTERPRETER_INTERFACES_SCRIPTEDFRAMEPROVIDERINTERFACE_H
10#define LLDB_INTERPRETER_INTERFACES_SCRIPTEDFRAMEPROVIDERINTERFACE_H
11
12#include "lldb/lldb-private.h"
13
14#include "ScriptedInterface.h"
15
16namespace lldb_private {
18public:
19 virtual bool AppliesToThread(llvm::StringRef class_name,
20 lldb::ThreadSP thread_sp) {
21 return true;
22 }
23
24 virtual llvm::Expected<StructuredData::GenericSP>
25 CreatePluginObject(llvm::StringRef class_name,
26 lldb::StackFrameListSP input_frames,
28
29 /// Get a description string for the frame provider.
30 ///
31 /// This is called by the descriptor to fetch a description from the
32 /// scripted implementation. Implementations should call a static method
33 /// on the scripting class to retrieve the description.
34 ///
35 /// \param class_name The name of the scripting class implementing the
36 /// provider.
37 ///
38 /// \return A string describing what this frame provider does, or an
39 /// empty string if no description is available.
40 virtual std::string GetDescription(llvm::StringRef class_name) { return {}; }
41
42 /// Get the priority of this frame provider.
43 ///
44 /// This is called by the descriptor to fetch the priority from the
45 /// scripted implementation. Implementations should call a static method
46 /// on the scripting class to retrieve the priority. Lower numbers indicate
47 /// higher priority (like Unix nice values).
48 ///
49 /// \param class_name The name of the scripting class implementing the
50 /// provider.
51 ///
52 /// \return Priority value where 0 is highest priority, or std::nullopt for
53 /// default priority (UINT32_MAX - lowest priority).
54 virtual std::optional<uint32_t> GetPriority(llvm::StringRef class_name) {
55 return std::nullopt;
56 }
57
58 virtual StructuredData::ObjectSP GetFrameAtIndex(uint32_t index) {
59 return {};
60 }
61};
62} // namespace lldb_private
63
64#endif // LLDB_INTERPRETER_INTERFACES_SCRIPTEDFRAMEPROVIDERINTERFACE_H
virtual llvm::Expected< StructuredData::GenericSP > CreatePluginObject(llvm::StringRef class_name, lldb::StackFrameListSP input_frames, StructuredData::DictionarySP args_sp)=0
virtual std::optional< uint32_t > GetPriority(llvm::StringRef class_name)
Get the priority of this frame provider.
virtual StructuredData::ObjectSP GetFrameAtIndex(uint32_t index)
virtual std::string GetDescription(llvm::StringRef class_name)
Get a description string for the frame provider.
virtual bool AppliesToThread(llvm::StringRef class_name, lldb::ThreadSP thread_sp)
std::shared_ptr< Dictionary > DictionarySP
std::shared_ptr< Object > ObjectSP
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::Thread > ThreadSP
std::shared_ptr< lldb_private::StackFrameList > StackFrameListSP