LLDB mainline
lldb_private::FormatManager Class Reference

#include <FormatManager.h>

Inheritance diagram for lldb_private::FormatManager:
[legend]

Public Types

typedef std::map< lldb::LanguageType, LanguageCategory::UniquePointerLanguageCategories

Public Member Functions

 FormatManager ()
 ~FormatManager () override=default
NamedSummariesMapGetNamedSummaryContainer ()
void EnableCategory (ConstString category_name, TypeCategoryMap::Position pos=TypeCategoryMap::Default)
void EnableCategory (ConstString category_name, TypeCategoryMap::Position pos, lldb::LanguageType lang)
void DisableCategory (ConstString category_name)
void EnableCategory (const lldb::TypeCategoryImplSP &category, TypeCategoryMap::Position pos=TypeCategoryMap::Default)
void DisableCategory (const lldb::TypeCategoryImplSP &category)
void EnableAllCategories ()
void DisableAllCategories ()
bool DeleteCategory (ConstString category_name)
void ClearCategories ()
uint32_t GetCategoriesCount ()
lldb::TypeCategoryImplSP GetCategoryAtIndex (size_t index)
void ForEachCategory (TypeCategoryMap::ForEachCallback callback)
lldb::TypeCategoryImplSP GetCategory (const char *category_name=nullptr, bool can_create=true)
lldb::TypeCategoryImplSP GetCategory (ConstString category_name, bool can_create=true)
lldb::TypeFormatImplSP GetFormatForType (lldb::TypeNameSpecifierImplSP type_sp)
lldb::TypeSummaryImplSP GetSummaryForType (lldb::TypeNameSpecifierImplSP type_sp)
lldb::TypeFilterImplSP GetFilterForType (lldb::TypeNameSpecifierImplSP type_sp)
lldb::ScriptedSyntheticChildrenSP GetSyntheticForType (lldb::TypeNameSpecifierImplSP type_sp)
lldb::TypeFormatImplSP GetFormat (ValueObject &valobj, lldb::DynamicValueType use_dynamic)
lldb::TypeSummaryImplSP GetSummaryFormat (ValueObject &valobj, lldb::DynamicValueType use_dynamic)
lldb::SyntheticChildrenSP GetSyntheticChildren (ValueObject &valobj, lldb::DynamicValueType use_dynamic)
bool AnyMatches (const FormattersMatchCandidate &candidate_type, TypeCategoryImpl::FormatCategoryItems items=TypeCategoryImpl::ALL_ITEM_TYPES, bool only_enabled=true, const char **matching_category=nullptr, TypeCategoryImpl::FormatCategoryItems *matching_type=nullptr)
bool ShouldPrintAsOneLiner (ValueObject &valobj)
void Changed () override
uint32_t GetCurrentRevision () override
LanguageCategoryGetCategoryForLanguage (lldb::LanguageType lang_type)
Public Member Functions inherited from lldb_private::IFormatChangeListener
virtual ~IFormatChangeListener ()=default

Static Public Member Functions

static bool GetFormatFromCString (const char *format_cstr, lldb::Format &format)
static char GetFormatAsFormatChar (lldb::Format format)
static const char * GetFormatAsCString (lldb::Format format)
static lldb::Format GetSingleItemFormat (lldb::Format vector_format)
static FormattersMatchVector GetPossibleMatches (ValueObject &valobj, lldb::DynamicValueType use_dynamic)
static ConstString GetTypeForCache (ValueObject &, lldb::DynamicValueType)
static std::vector< lldb::LanguageTypeGetCandidateLanguages (lldb::LanguageType lang_type)

Private Types

typedef FormattersContainer< TypeSummaryImplNamedSummariesMap
typedef TypeCategoryMap::MapType::iterator CategoryMapIterator

Private Member Functions

template<typename ImplSP>
ImplSP Get (ValueObject &valobj, lldb::DynamicValueType use_dynamic)
template<typename ImplSP>
ImplSP GetCached (FormattersMatchData &match_data)
template<typename ImplSP>
ImplSP GetHardcoded (FormattersMatchData &)
TypeCategoryMapGetCategories ()
void LoadSystemFormatters ()
void LoadVectorFormatters ()

Static Private Member Functions

static void GetPossibleMatches (ValueObject &valobj, CompilerType compiler_type, lldb::DynamicValueType use_dynamic, FormattersMatchVector &entries, FormattersMatchCandidate::Flags current_flags, bool root_level=false, uint32_t ptr_stripped_depth=0)

Private Attributes

std::atomic< uint32_t > m_last_revision
FormatCache m_format_cache
std::recursive_mutex m_language_categories_mutex
LanguageCategories m_language_categories_map
NamedSummariesMap m_named_summaries_map
TypeCategoryMap m_categories_map
ConstString m_default_category_name
ConstString m_system_category_name
ConstString m_vectortypes_category_name

Friends

class FormattersMatchData

Detailed Description

Definition at line 36 of file FormatManager.h.

Member Typedef Documentation

◆ CategoryMapIterator

typedef TypeCategoryMap::MapType::iterator lldb_private::FormatManager::CategoryMapIterator
private

Definition at line 38 of file FormatManager.h.

◆ LanguageCategories

◆ NamedSummariesMap

Constructor & Destructor Documentation

◆ FormatManager()

◆ ~FormatManager()

lldb_private::FormatManager::~FormatManager ( )
overridedefault

Member Function Documentation

◆ AnyMatches()

bool lldb_private::FormatManager::AnyMatches ( const FormattersMatchCandidate & candidate_type,
TypeCategoryImpl::FormatCategoryItems items = TypeCategoryImpl::ALL_ITEM_TYPES,
bool only_enabled = true,
const char ** matching_category = nullptr,
TypeCategoryImpl::FormatCategoryItems * matching_type = nullptr )
inline

◆ Changed()

void FormatManager::Changed ( )
overridevirtual

◆ ClearCategories()

void lldb_private::FormatManager::ClearCategories ( )
inline

Definition at line 89 of file FormatManager.h.

References m_categories_map.

Referenced by lldb_private::DataVisualization::Categories::Clear().

◆ DeleteCategory()

bool lldb_private::FormatManager::DeleteCategory ( ConstString category_name)
inline

Definition at line 85 of file FormatManager.h.

References m_categories_map.

Referenced by lldb_private::DataVisualization::Categories::Delete().

◆ DisableAllCategories()

void FormatManager::DisableAllCategories ( )

◆ DisableCategory() [1/2]

void lldb_private::FormatManager::DisableCategory ( const lldb::TypeCategoryImplSP & category)
inline

Definition at line 77 of file FormatManager.h.

References m_categories_map.

◆ DisableCategory() [2/2]

◆ EnableAllCategories()

void FormatManager::EnableAllCategories ( )

◆ EnableCategory() [1/3]

void lldb_private::FormatManager::EnableCategory ( const lldb::TypeCategoryImplSP & category,
TypeCategoryMap::Position pos = TypeCategoryMap::Default )
inline

Definition at line 72 of file FormatManager.h.

References lldb_private::TypeCategoryMap::Default, and m_categories_map.

◆ EnableCategory() [2/3]

void lldb_private::FormatManager::EnableCategory ( ConstString category_name,
TypeCategoryMap::Position pos,
lldb::LanguageType lang )
inline

Definition at line 58 of file FormatManager.h.

References m_categories_map.

◆ EnableCategory() [3/3]

◆ ForEachCategory()

void FormatManager::ForEachCategory ( TypeCategoryMap::ForEachCallback callback)

◆ Get()

◆ GetCached()

◆ GetCandidateLanguages()

◆ GetCategories()

TypeCategoryMap & lldb_private::FormatManager::GetCategories ( )
inlineprivate

Definition at line 202 of file FormatManager.h.

References m_categories_map.

◆ GetCategoriesCount()

uint32_t lldb_private::FormatManager::GetCategoriesCount ( )
inline

Definition at line 91 of file FormatManager.h.

References m_categories_map.

Referenced by lldb_private::DataVisualization::Categories::GetCount().

◆ GetCategory() [1/2]

◆ GetCategory() [2/2]

lldb::TypeCategoryImplSP FormatManager::GetCategory ( ConstString category_name,
bool can_create = true )

Definition at line 416 of file FormatManager.cpp.

References GetCategory(), m_categories_map, and m_default_category_name.

◆ GetCategoryAtIndex()

lldb::TypeCategoryImplSP lldb_private::FormatManager::GetCategoryAtIndex ( size_t index)
inline

◆ GetCategoryForLanguage()

LanguageCategory * FormatManager::GetCategoryForLanguage ( lldb::LanguageType lang_type)

Definition at line 595 of file FormatManager.cpp.

References m_language_categories_map, and m_language_categories_mutex.

Referenced by Get(), and GetHardcoded().

◆ GetCurrentRevision()

uint32_t lldb_private::FormatManager::GetCurrentRevision ( )
inlineoverridevirtual

◆ GetFilterForType()

lldb::TypeFilterImplSP FormatManager::GetFilterForType ( lldb::TypeNameSpecifierImplSP type_sp)

◆ GetFormat()

◆ GetFormatAsCString()

◆ GetFormatAsFormatChar()

char FormatManager::GetFormatAsFormatChar ( lldb::Format format)
static

◆ GetFormatForType()

lldb::TypeFormatImplSP FormatManager::GetFormatForType ( lldb::TypeNameSpecifierImplSP type_sp)

◆ GetFormatFromCString()

bool FormatManager::GetFormatFromCString ( const char * format_cstr,
lldb::Format & format )
static

◆ GetHardcoded()

template<typename ImplSP>
ImplSP FormatManager::GetHardcoded ( FormattersMatchData & match_data)
private

◆ GetNamedSummaryContainer()

◆ GetPossibleMatches() [1/2]

void FormatManager::GetPossibleMatches ( ValueObject & valobj,
CompilerType compiler_type,
lldb::DynamicValueType use_dynamic,
FormattersMatchVector & entries,
FormattersMatchCandidate::Flags current_flags,
bool root_level = false,
uint32_t ptr_stripped_depth = 0 )
staticprivate

Definition at line 175 of file FormatManager.cpp.

References lldb_private::ConstString::AsCString(), lldb_private::Language::FindPlugin(), lldb_private::CompilerType::GetArrayElementType(), lldb_private::CompilerType::GetArrayType(), lldb_private::ExecutionContext::GetBestExecutionContextScope(), lldb_private::ValueObject::GetBitfieldBitSize(), GetCandidateLanguages(), lldb_private::ValueObject::GetExecutionContextRef(), lldb_private::CompilerType::GetFullyUnqualifiedType(), lldb_private::CompilerType::GetLValueReferenceType(), lldb_private::CompilerType::GetNonReferenceType(), lldb_private::ValueObject::GetObjectRuntimeLanguage(), lldb_private::CompilerType::GetOpaqueQualType(), lldb_private::CompilerType::GetPointeeType(), lldb_private::CompilerType::GetPointerType(), GetPossibleMatches(), lldb_private::CompilerType::GetRValueReferenceType(), lldb_private::ValueObject::GetStaticValue(), lldb_private::StreamString::GetString(), lldb_private::ValueObject::GetTargetSP(), lldb_private::CompilerType::GetTypedefedType(), lldb_private::CompilerType::GetTypeForFormatters(), lldb_private::CompilerType::GetTypeName(), lldb_private::CompilerType::IsArrayType(), lldb_private::ValueObject::IsDynamic(), lldb_private::CompilerType::IsMeaninglessWithoutDynamicResolution(), lldb_private::CompilerType::IsPointerType(), lldb_private::CompilerType::IsReferenceType(), lldb_private::CompilerType::IsTypedefType(), lldb_private::CompilerType::IsValid(), lldb_private::Stream::Printf(), lldb_private::FormattersMatchCandidate::Flags::WithStrippedPointer(), lldb_private::FormattersMatchCandidate::Flags::WithStrippedReference(), and lldb_private::FormattersMatchCandidate::Flags::WithStrippedTypedef().

◆ GetPossibleMatches() [2/2]

FormattersMatchVector lldb_private::FormatManager::GetPossibleMatches ( ValueObject & valobj,
lldb::DynamicValueType use_dynamic )
inlinestatic

◆ GetSingleItemFormat()

◆ GetSummaryFormat()

◆ GetSummaryForType()

lldb::TypeSummaryImplSP FormatManager::GetSummaryForType ( lldb::TypeNameSpecifierImplSP type_sp)

◆ GetSyntheticChildren()

◆ GetSyntheticForType()

◆ GetTypeForCache()

ConstString FormatManager::GetTypeForCache ( ValueObject & valobj,
lldb::DynamicValueType use_dynamic )
static

◆ LoadSystemFormatters()

◆ LoadVectorFormatters()

◆ ShouldPrintAsOneLiner()

◆ FormattersMatchData

friend class FormattersMatchData
friend

Definition at line 214 of file FormatManager.h.

References FormattersMatchData.

Referenced by FormattersMatchData, Get(), GetCached(), and GetHardcoded().

Member Data Documentation

◆ m_categories_map

◆ m_default_category_name

ConstString lldb_private::FormatManager::m_default_category_name
private

Definition at line 193 of file FormatManager.h.

Referenced by FormatManager(), GetCategory(), and GetCategory().

◆ m_format_cache

FormatCache lldb_private::FormatManager::m_format_cache
private

Definition at line 187 of file FormatManager.h.

Referenced by Changed(), FormatManager(), and GetCached().

◆ m_language_categories_map

LanguageCategories lldb_private::FormatManager::m_language_categories_map
private

◆ m_language_categories_mutex

std::recursive_mutex lldb_private::FormatManager::m_language_categories_mutex
private

◆ m_last_revision

std::atomic<uint32_t> lldb_private::FormatManager::m_last_revision
private

Definition at line 186 of file FormatManager.h.

Referenced by Changed(), FormatManager(), and GetCurrentRevision().

◆ m_named_summaries_map

NamedSummariesMap lldb_private::FormatManager::m_named_summaries_map
private

Definition at line 190 of file FormatManager.h.

Referenced by FormatManager(), and GetNamedSummaryContainer().

◆ m_system_category_name

ConstString lldb_private::FormatManager::m_system_category_name
private

Definition at line 194 of file FormatManager.h.

Referenced by FormatManager(), and LoadSystemFormatters().

◆ m_vectortypes_category_name

ConstString lldb_private::FormatManager::m_vectortypes_category_name
private

Definition at line 195 of file FormatManager.h.

Referenced by FormatManager(), and LoadVectorFormatters().


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