34 if (!description.empty())
35 s->
Printf(
" Description: %s\n", description.c_str());
39 s->
PutCString(
" Thread Filter: (applies to all threads)\n");
69 return llvm::createStringError(
70 "cannot create synthetic frame provider: invalid input frames");
74 for (uint32_t idx = 0;
79 auto provider_or_err = create_callback(input_frames, descriptor);
80 if (!provider_or_err) {
82 "Failed to create synthetic frame provider: {0}");
86 if (
auto frame_provider_up = std::move(*provider_or_err))
87 return std::move(frame_provider_up);
90 return llvm::createStringError(
91 "cannot create synthetic frame provider: no suitable plugin found");
96 const std::vector<ThreadSpec> &thread_specs) {
98 return llvm::createStringError(
99 "cannot create synthetic frame provider: invalid input frames");
106 if (!create_callback)
107 return llvm::createStringError(
108 "cannot create synthetic frame provider: C++ plugin '%s' not found",
109 plugin_name.str().c_str());
111 auto provider_or_err = create_callback(input_frames, thread_specs);
112 if (!provider_or_err)
113 return provider_or_err.takeError();
115 if (
auto frame_provider_sp = std::move(*provider_or_err))
116 return std::move(frame_provider_sp);
118 return llvm::createStringError(
119 "cannot create synthetic frame provider: C++ plugin '%s' returned null",
120 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.