34 if (!description.empty())
35 s->
Printf(
" Description: %s\n", description.c_str());
39 if (priority.has_value())
40 s->
Printf(
" Priority: %u\n", *priority);
42 s->
PutCString(
" Priority: Default (no priority specified)\n");
46 s->
PutCString(
" Thread Filter: (applies to all threads)\n");
83 return llvm::createStringError(
84 "cannot create synthetic frame provider: invalid input frames");
88 for (uint32_t idx = 0;
93 auto provider_or_err = create_callback(input_frames, descriptor);
94 if (!provider_or_err) {
96 "Failed to create synthetic frame provider: {0}");
100 if (
auto frame_provider_up = std::move(*provider_or_err))
101 return std::move(frame_provider_up);
104 return llvm::createStringError(
105 "cannot create synthetic frame provider: no suitable plugin found");
110 const std::vector<ThreadSpec> &thread_specs) {
112 return llvm::createStringError(
113 "cannot create synthetic frame provider: invalid input frames");
120 if (!create_callback)
121 return llvm::createStringError(
122 "cannot create synthetic frame provider: C++ plugin '%s' not found",
123 plugin_name.str().c_str());
125 auto provider_or_err = create_callback(input_frames, thread_specs);
126 if (!provider_or_err)
127 return provider_or_err.takeError();
129 if (
auto frame_provider_sp = std::move(*provider_or_err))
130 return std::move(frame_provider_sp);
132 return llvm::createStringError(
133 "cannot create synthetic frame provider: C++ plugin '%s' returned null",
134 plugin_name.str().c_str());
#define LLDB_LOG_ERROR(log, error,...)
static SyntheticFrameProviderCreateInstance GetSyntheticFrameProviderCreateCallbackForPluginName(llvm::StringRef name)
static ScriptedFrameProviderCreateInstance GetScriptedFrameProviderCreateCallbackAtIndex(uint32_t idx)
A stream class that can stream formatted output to a file.
void Format(const char *format, Args &&... args)
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
~SyntheticFrameProvider() override
static llvm::Expected< lldb::SyntheticFrameProviderSP > CreateInstance(lldb::StackFrameListSP input_frames, const ScriptedFrameProviderDescriptor &descriptor)
Try to create a SyntheticFrameProvider instance for the given input frames and descriptor.
lldb::StackFrameListSP m_input_frames
SyntheticFrameProvider(lldb::StackFrameListSP input_frames)
void GetDescription(Stream *s, lldb::DescriptionLevel level) const
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
llvm::Expected< lldb::SyntheticFrameProviderSP >(* SyntheticFrameProviderCreateInstance)(lldb::StackFrameListSP input_frames, const std::vector< lldb_private::ThreadSpec > &thread_specs)
llvm::Expected< lldb::SyntheticFrameProviderSP >(* ScriptedFrameProviderCreateInstance)(lldb::StackFrameListSP input_frames, const lldb_private::ScriptedFrameProviderDescriptor &descriptor)
@ eDescriptionLevelVerbose
std::shared_ptr< lldb_private::StackFrameList > StackFrameListSP
This struct contains the metadata needed to instantiate a frame provider and optional filters to cont...
std::vector< ThreadSpec > thread_specs
Optional list of thread specifications to which this provider applies.
uint32_t GetID() const
Get a unique identifier for this descriptor based on its contents.
lldb::ScriptedMetadataSP scripted_metadata_sp
Metadata for instantiating the provider (e.g. script class name and args).
void Dump(Stream *s) const
Dump a description of this descriptor to the given stream.
llvm::StringRef GetName() const
Get the name of this descriptor (the scripted class name).
lldb::ScriptedFrameProviderInterfaceSP interface_sp
Interface for calling static methods on the provider class.
std::string GetDescription() const
Get the description of this frame provider.
std::optional< uint32_t > GetPriority() const
Get the priority of this frame provider.