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");
87 for (
auto create_callback :
89 auto provider_or_err = create_callback(input_frames, descriptor);
90 if (!provider_or_err) {
92 "Failed to create synthetic frame provider: {0}");
96 if (
auto frame_provider_up = std::move(*provider_or_err))
97 return std::move(frame_provider_up);
100 return llvm::createStringError(
101 "cannot create synthetic frame provider: no suitable plugin found");
106 const std::vector<ThreadSpec> &thread_specs) {
108 return llvm::createStringError(
109 "cannot create synthetic frame provider: invalid input frames");
116 if (!create_callback)
117 return llvm::createStringError(
118 "cannot create synthetic frame provider: C++ plugin '%s' not found",
119 plugin_name.str().c_str());
121 auto provider_or_err = create_callback(input_frames, thread_specs);
122 if (!provider_or_err)
123 return provider_or_err.takeError();
125 if (
auto frame_provider_sp = std::move(*provider_or_err))
126 return std::move(frame_provider_sp);
128 return llvm::createStringError(
129 "cannot create synthetic frame provider: C++ plugin '%s' returned null",
130 plugin_name.str().c_str());
#define LLDB_LOG_ERROR(log, error,...)
static SyntheticFrameProviderCreateInstance GetSyntheticFrameProviderCreateCallbackForPluginName(llvm::StringRef name)
static llvm::SmallVector< ScriptedFrameProviderCreateInstance > GetScriptedFrameProviderCreateCallbacks()
A stream class that can stream formatted output to a file.
void Format(const char *format, Args &&... args)
Forwards the arguments to llvm::formatv and writes to the stream.
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)
@ 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.