LLDB mainline
lldb_private::ScriptedFrameProviderDescriptor Struct Reference

This struct contains the metadata needed to instantiate a frame provider and optional filters to control which threads it applies to. More...

#include <SyntheticFrameProvider.h>

Public Member Functions

 ScriptedFrameProviderDescriptor ()=default
 ScriptedFrameProviderDescriptor (lldb::ScriptedMetadataSP metadata_sp)
 ScriptedFrameProviderDescriptor (lldb::ScriptedMetadataSP metadata_sp, const std::vector< ThreadSpec > &specs)
llvm::StringRef GetName () const
 Get the name of this descriptor (the scripted class name).
std::string GetDescription () const
 Get the description of this frame provider.
std::optional< uint32_t > GetPriority () const
 Get the priority of this frame provider.
bool AppliesToThread (Thread &thread) const
 Check if this descriptor applies to the given thread.
bool IsValid () const
 Check if this descriptor has valid metadata for script-based providers.
uint32_t GetID () const
 Get a unique identifier for this descriptor.
void SetID (uint32_t id)
 Set the monotonically increasing ID for this descriptor.
uint32_t GetHash () const
 Get the content-based hash from ScriptedMetadata.
void Dump (Stream *s) const
 Dump a description of this descriptor to the given stream.

Public Attributes

lldb::ScriptedMetadataSP scripted_metadata_sp
 Metadata for instantiating the provider (e.g. script class name and args).
lldb::ScriptedFrameProviderInterfaceSP interface_sp
 Interface for calling static methods on the provider class.
std::vector< ThreadSpecthread_specs
 Optional list of thread specifications to which this provider applies.
uint32_t m_id = LLDB_INVALID_FRAME_PROVIDER_ID
 Monotonically increasing ID assigned by Target when this descriptor is registered.

Detailed Description

This struct contains the metadata needed to instantiate a frame provider and optional filters to control which threads it applies to.

Definition at line 27 of file SyntheticFrameProvider.h.

Constructor & Destructor Documentation

◆ ScriptedFrameProviderDescriptor() [1/3]

lldb_private::ScriptedFrameProviderDescriptor::ScriptedFrameProviderDescriptor ( )
default

◆ ScriptedFrameProviderDescriptor() [2/3]

lldb_private::ScriptedFrameProviderDescriptor::ScriptedFrameProviderDescriptor ( lldb::ScriptedMetadataSP metadata_sp)
inline

Definition at line 46 of file SyntheticFrameProvider.h.

References scripted_metadata_sp.

◆ ScriptedFrameProviderDescriptor() [3/3]

lldb_private::ScriptedFrameProviderDescriptor::ScriptedFrameProviderDescriptor ( lldb::ScriptedMetadataSP metadata_sp,
const std::vector< ThreadSpec > & specs )
inline

Definition at line 49 of file SyntheticFrameProvider.h.

References scripted_metadata_sp, and thread_specs.

Member Function Documentation

◆ AppliesToThread()

bool lldb_private::ScriptedFrameProviderDescriptor::AppliesToThread ( Thread & thread) const
inline

Check if this descriptor applies to the given thread.

Definition at line 75 of file SyntheticFrameProvider.h.

References thread_specs.

Referenced by lldb_private::ScriptedFrameProvider::CreateInstance(), and lldb_private::Thread::GetStackFrameList().

◆ Dump()

◆ GetDescription()

std::string ScriptedFrameProviderDescriptor::GetDescription ( ) const

Get the description of this frame provider.

Returns
A string describing what this frame provider does, or an empty string if no description is available.

Definition at line 65 of file SyntheticFrameProvider.cpp.

References interface_sp, and scripted_metadata_sp.

Referenced by Dump().

◆ GetHash()

uint32_t ScriptedFrameProviderDescriptor::GetHash ( ) const

Get the content-based hash from ScriptedMetadata.

Used for duplicate detection (same class name + args).

Definition at line 58 of file SyntheticFrameProvider.cpp.

References scripted_metadata_sp.

Referenced by lldb_private::Target::AddScriptedFrameProviderDescriptor().

◆ GetID()

uint32_t lldb_private::ScriptedFrameProviderDescriptor::GetID ( ) const
inline

Get a unique identifier for this descriptor.

Returns the monotonically increasing ID assigned by Target if set, otherwise returns LLDB_INVALID_FRAME_PROVIDER_ID (UINT32_MAX).

Definition at line 94 of file SyntheticFrameProvider.h.

References m_id.

Referenced by Dump(), and lldb_private::Thread::LoadScriptedFrameProvider().

◆ GetName()

llvm::StringRef lldb_private::ScriptedFrameProviderDescriptor::GetName ( ) const
inline

Get the name of this descriptor (the scripted class name).

Definition at line 54 of file SyntheticFrameProvider.h.

References scripted_metadata_sp.

Referenced by lldb_private::Target::AddScriptedFrameProviderDescriptor(), and Dump().

◆ GetPriority()

std::optional< uint32_t > ScriptedFrameProviderDescriptor::GetPriority ( ) const

Get the priority of this frame provider.

Priority determines the order in which providers are evaluated when multiple providers could apply to the same thread. Lower numbers indicate higher priority (like Unix nice values).

Returns
Priority value where 0 is highest priority, or std::nullopt for default priority (UINT32_MAX - lowest priority).

Definition at line 72 of file SyntheticFrameProvider.cpp.

References interface_sp, and scripted_metadata_sp.

Referenced by Dump(), and lldb_private::Thread::GetStackFrameList().

◆ IsValid()

bool lldb_private::ScriptedFrameProviderDescriptor::IsValid ( ) const
inline

Check if this descriptor has valid metadata for script-based providers.

Definition at line 89 of file SyntheticFrameProvider.h.

References scripted_metadata_sp.

Referenced by lldb_private::Target::AddScriptedFrameProviderDescriptor(), lldb_private::ScriptedFrameProvider::CreateInstance(), and lldb_private::Thread::GetStackFrameList().

◆ SetID()

void lldb_private::ScriptedFrameProviderDescriptor::SetID ( uint32_t id)
inline

Set the monotonically increasing ID for this descriptor.

Called by Target when the descriptor is registered.

Definition at line 98 of file SyntheticFrameProvider.h.

References m_id.

Referenced by lldb_private::Target::AddScriptedFrameProviderDescriptor().

Member Data Documentation

◆ interface_sp

lldb::ScriptedFrameProviderInterfaceSP lldb_private::ScriptedFrameProviderDescriptor::interface_sp

Interface for calling static methods on the provider class.

Definition at line 32 of file SyntheticFrameProvider.h.

Referenced by CommandObjectTargetFrameProviderRegister::DoExecute(), GetDescription(), GetPriority(), and lldb::SBTarget::RegisterScriptedFrameProvider().

◆ m_id

uint32_t lldb_private::ScriptedFrameProviderDescriptor::m_id = LLDB_INVALID_FRAME_PROVIDER_ID

Monotonically increasing ID assigned by Target when this descriptor is registered.

LLDB_INVALID_FRAME_PROVIDER_ID (UINT32_MAX) means no ID has been assigned yet.

Definition at line 42 of file SyntheticFrameProvider.h.

Referenced by GetID(), and SetID().

◆ scripted_metadata_sp

lldb::ScriptedMetadataSP lldb_private::ScriptedFrameProviderDescriptor::scripted_metadata_sp

Metadata for instantiating the provider (e.g. script class name and args).

Definition at line 29 of file SyntheticFrameProvider.h.

Referenced by lldb_private::ScriptedFrameProvider::CreateInstance(), GetDescription(), GetHash(), GetName(), GetPriority(), IsValid(), ScriptedFrameProviderDescriptor(), and ScriptedFrameProviderDescriptor().

◆ thread_specs

std::vector<ThreadSpec> lldb_private::ScriptedFrameProviderDescriptor::thread_specs

Optional list of thread specifications to which this provider applies.

If empty, the provider applies to all threads. A thread matches if it satisfies ANY of the specs in this vector (OR logic).

Definition at line 37 of file SyntheticFrameProvider.h.

Referenced by AppliesToThread(), Dump(), and ScriptedFrameProviderDescriptor().


The documentation for this struct was generated from the following files: