LLDB mainline
Public Types | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
lldb_private::FormatManager Class Reference

#include <FormatManager.h>

Inheritance diagram for lldb_private::FormatManager:
Inheritance graph
[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
 
virtual void Changed ()=0
 
virtual uint32_t GetCurrentRevision ()=0
 

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)
 

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

Definition at line 42 of file FormatManager.h.

◆ NamedSummariesMap

Definition at line 37 of file FormatManager.h.

Constructor & Destructor Documentation

◆ FormatManager()

FormatManager::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

◆ DeleteCategory()

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

◆ 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 lldb_private::TypeCategoryMap::Disable(), and m_categories_map.

◆ DisableCategory() [2/2]

void lldb_private::FormatManager::DisableCategory ( ConstString  category_name)
inline

◆ 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::Enable(), and m_categories_map.

◆ EnableCategory() [2/3]

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

◆ EnableCategory() [3/3]

void lldb_private::FormatManager::EnableCategory ( ConstString  category_name,
TypeCategoryMap::Position  pos = TypeCategoryMap::Default 
)
inline

◆ ForEachCategory()

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

◆ Get()

template<typename ImplSP >
ImplSP FormatManager::Get ( ValueObject valobj,
lldb::DynamicValueType  use_dynamic 
)
private

◆ GetCached()

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

◆ GetCandidateLanguages()

std::vector< lldb::LanguageType > FormatManager::GetCandidateLanguages ( lldb::LanguageType  lang_type)
static

◆ GetCategories()

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

Definition at line 201 of file FormatManager.h.

References m_categories_map.

◆ GetCategoriesCount()

uint32_t lldb_private::FormatManager::GetCategoriesCount ( )
inline

◆ GetCategory() [1/2]

lldb::TypeCategoryImplSP lldb_private::FormatManager::GetCategory ( const char *  category_name = nullptr,
bool  can_create = true 
)
inline

◆ GetCategory() [2/2]

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

◆ GetCategoryAtIndex()

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

◆ GetCategoryForLanguage()

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

Definition at line 587 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()

lldb::TypeFormatImplSP FormatManager::GetFormat ( ValueObject valobj,
lldb::DynamicValueType  use_dynamic 
)

◆ GetFormatAsCString()

const char * FormatManager::GetFormatAsCString ( lldb::Format  format)
static

◆ 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()

NamedSummariesMap & lldb_private::FormatManager::GetNamedSummaryContainer ( )
inline

◆ 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 
)
staticprivate

Definition at line 174 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]

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

◆ GetSingleItemFormat()

lldb::Format FormatManager::GetSingleItemFormat ( lldb::Format  vector_format)
static

◆ GetSummaryFormat()

lldb::TypeSummaryImplSP FormatManager::GetSummaryFormat ( ValueObject valobj,
lldb::DynamicValueType  use_dynamic 
)

◆ GetSummaryForType()

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

◆ GetSyntheticChildren()

lldb::SyntheticChildrenSP FormatManager::GetSyntheticChildren ( ValueObject valobj,
lldb::DynamicValueType  use_dynamic 
)

◆ GetSyntheticForType()

lldb::ScriptedSyntheticChildrenSP FormatManager::GetSyntheticForType ( lldb::TypeNameSpecifierImplSP  type_sp)

◆ GetTypeForCache()

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

◆ LoadSystemFormatters()

void FormatManager::LoadSystemFormatters ( )
private

◆ LoadVectorFormatters()

void FormatManager::LoadVectorFormatters ( )
private

◆ ShouldPrintAsOneLiner()

bool FormatManager::ShouldPrintAsOneLiner ( ValueObject valobj)

Friends And Related Function Documentation

◆ FormattersMatchData

friend class FormattersMatchData
friend

Definition at line 213 of file FormatManager.h.

Member Data Documentation

◆ m_categories_map

TypeCategoryMap lldb_private::FormatManager::m_categories_map
private

◆ m_default_category_name

ConstString lldb_private::FormatManager::m_default_category_name
private

Definition at line 192 of file FormatManager.h.

Referenced by GetCategory().

◆ m_format_cache

FormatCache lldb_private::FormatManager::m_format_cache
private

Definition at line 186 of file FormatManager.h.

Referenced by Changed(), 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 185 of file FormatManager.h.

Referenced by Changed(), and GetCurrentRevision().

◆ m_named_summaries_map

NamedSummariesMap lldb_private::FormatManager::m_named_summaries_map
private

Definition at line 189 of file FormatManager.h.

Referenced by GetNamedSummaryContainer().

◆ m_system_category_name

ConstString lldb_private::FormatManager::m_system_category_name
private

Definition at line 193 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 194 of file FormatManager.h.

Referenced by FormatManager(), and LoadVectorFormatters().


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