LLDB mainline
|
#include <FormatManager.h>
Public Types | |
typedef std::map< lldb::LanguageType, LanguageCategory::UniquePointer > | LanguageCategories |
Public Member Functions | |
FormatManager () | |
~FormatManager () override=default | |
NamedSummariesMap & | GetNamedSummaryContainer () |
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 |
LanguageCategory * | GetCategoryForLanguage (lldb::LanguageType lang_type) |
![]() | |
virtual | ~IFormatChangeListener ()=default |
virtual void | Changed ()=0 |
virtual uint32_t | GetCurrentRevision ()=0 |
Static Public Member Functions | |
static bool | GetFormatFromCString (const char *format_cstr, bool partial_match_ok, 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::LanguageType > | GetCandidateLanguages (lldb::LanguageType lang_type) |
Private Types | |
typedef FormattersContainer< TypeSummaryImpl > | NamedSummariesMap |
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 &) |
TypeCategoryMap & | GetCategories () |
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) |
Friends | |
class | FormattersMatchData |
Definition at line 36 of file FormatManager.h.
|
private |
Definition at line 38 of file FormatManager.h.
typedef std::map<lldb::LanguageType, LanguageCategory::UniquePointer> lldb_private::FormatManager::LanguageCategories |
Definition at line 42 of file FormatManager.h.
Definition at line 37 of file FormatManager.h.
FormatManager::FormatManager | ( | ) |
Definition at line 676 of file FormatManager.cpp.
References lldb::eLanguageTypeObjC_plus_plus, EnableCategory(), lldb_private::TypeCategoryMap::Last, LoadSystemFormatters(), LoadVectorFormatters(), m_system_category_name, and m_vectortypes_category_name.
|
overridedefault |
|
inline |
Definition at line 131 of file FormatManager.h.
References lldb_private::TypeCategoryMap::AnyMatches(), and m_categories_map.
Referenced by lldb_private::DataVisualization::AnyMatches().
|
overridevirtual |
Implements lldb_private::IFormatChangeListener.
Definition at line 116 of file FormatManager.cpp.
References lldb_private::FormatCache::Clear(), m_format_cache, m_language_categories_map, m_language_categories_mutex, and m_last_revision.
Referenced by lldb_private::DataVisualization::ForceUpdate().
|
inline |
Definition at line 89 of file FormatManager.h.
References lldb_private::TypeCategoryMap::Clear(), and m_categories_map.
Referenced by lldb_private::DataVisualization::Categories::Clear().
|
inline |
Definition at line 85 of file FormatManager.h.
References lldb_private::TypeCategoryMap::Delete(), and m_categories_map.
Referenced by lldb_private::DataVisualization::Categories::Delete().
void FormatManager::DisableAllCategories | ( | ) |
Definition at line 167 of file FormatManager.cpp.
References lldb_private::TypeCategoryMap::DisableAllCategories(), m_categories_map, m_language_categories_map, and m_language_categories_mutex.
Referenced by lldb_private::DataVisualization::Categories::DisableStar().
|
inline |
Definition at line 77 of file FormatManager.h.
References lldb_private::TypeCategoryMap::Disable(), and m_categories_map.
|
inline |
Definition at line 67 of file FormatManager.h.
References lldb_private::TypeCategoryMap::Disable(), and m_categories_map.
Referenced by lldb_private::DataVisualization::Categories::Delete(), lldb_private::DataVisualization::Categories::Disable(), and lldb_private::DataVisualization::Categories::Enable().
void FormatManager::EnableAllCategories | ( | ) |
Definition at line 158 of file FormatManager.cpp.
References lldb_private::TypeCategoryMap::EnableAllCategories(), m_categories_map, m_language_categories_map, and m_language_categories_mutex.
Referenced by lldb_private::DataVisualization::Categories::EnableStar().
|
inline |
Definition at line 72 of file FormatManager.h.
References lldb_private::TypeCategoryMap::Enable(), and m_categories_map.
|
inline |
Definition at line 58 of file FormatManager.h.
References lldb_private::TypeCategoryMap::Enable(), lldb_private::TypeCategoryMap::Get(), and m_categories_map.
|
inline |
Definition at line 53 of file FormatManager.h.
References EnableCategory().
Referenced by lldb_private::DataVisualization::Categories::Enable(), EnableCategory(), and FormatManager().
void FormatManager::ForEachCategory | ( | TypeCategoryMap::ForEachCallback | callback | ) |
Definition at line 391 of file FormatManager.cpp.
References lldb_private::TypeCategoryMap::ForEach(), m_categories_map, m_language_categories_map, and m_language_categories_mutex.
Referenced by lldb_private::DataVisualization::Categories::ForEach().
|
private |
Definition at line 600 of file FormatManager.cpp.
References lldb_private::DataFormatters, lldb_private::FormattersMatchData::GetCandidateLanguages(), GetCategoryForLanguage(), lldb_private::GetLog(), and LLDB_LOGF.
|
private |
Definition at line 627 of file FormatManager.cpp.
References lldb_private::ConstString::AsCString(), lldb_private::DataFormatters, lldb_private::FormatCache::Get(), lldb_private::TypeCategoryMap::Get(), lldb_private::FormatCache::GetCacheHits(), lldb_private::FormatCache::GetCacheMisses(), lldb_private::GetLog(), lldb_private::FormattersMatchData::GetTypeForCache(), LLDB_LOGF, LLDB_LOGV, m_categories_map, m_format_cache, and lldb_private::FormatCache::Set().
|
static |
Definition at line 557 of file FormatManager.cpp.
References lldb::eLanguageTypeC, lldb::eLanguageTypeC11, lldb::eLanguageTypeC89, lldb::eLanguageTypeC99, lldb::eLanguageTypeC_plus_plus, lldb::eLanguageTypeC_plus_plus_03, lldb::eLanguageTypeC_plus_plus_11, lldb::eLanguageTypeC_plus_plus_14, and lldb::eLanguageTypeObjC.
Referenced by GetPossibleMatches().
|
inlineprivate |
Definition at line 201 of file FormatManager.h.
References m_categories_map.
|
inline |
Definition at line 91 of file FormatManager.h.
References lldb_private::TypeCategoryMap::GetCount(), and m_categories_map.
Referenced by lldb_private::DataVisualization::Categories::GetCount().
|
inline |
Definition at line 99 of file FormatManager.h.
References GetCategory(), and m_default_category_name.
Referenced by lldb_private::DataVisualization::Categories::Add(), lldb_private::DataVisualization::Categories::Clear(), GetCategory(), lldb_private::DataVisualization::Categories::GetCategory(), lldb_private::CPlusPlusLanguage::GetHardcodedSummaries(), lldb_private::CPlusPlusLanguage::GetHardcodedSynthetics(), LoadSystemFormatters(), and LoadVectorFormatters().
lldb::TypeCategoryImplSP FormatManager::GetCategory | ( | ConstString | category_name, |
bool | can_create = true |
||
) |
Definition at line 403 of file FormatManager.cpp.
References lldb_private::TypeCategoryMap::Add(), lldb_private::TypeCategoryMap::Get(), GetCategory(), m_categories_map, and m_default_category_name.
|
inline |
Definition at line 93 of file FormatManager.h.
References lldb_private::TypeCategoryMap::GetAtIndex(), and m_categories_map.
Referenced by lldb_private::DataVisualization::Categories::GetCategoryAtIndex(), GetFilterForType(), GetFormatForType(), GetSummaryForType(), and GetSyntheticForType().
LanguageCategory * FormatManager::GetCategoryForLanguage | ( | lldb::LanguageType | lang_type | ) |
Definition at line 575 of file FormatManager.cpp.
References m_language_categories_map, and m_language_categories_mutex.
Referenced by Get(), and GetHardcoded().
|
inlineoverridevirtual |
Implements lldb_private::IFormatChangeListener.
Definition at line 160 of file FormatManager.h.
References m_last_revision.
Referenced by lldb_private::DataVisualization::GetCurrentRevision().
lldb::TypeFilterImplSP FormatManager::GetFilterForType | ( | lldb::TypeNameSpecifierImplSP | type_sp | ) |
Definition at line 343 of file FormatManager.cpp.
References GetCategoryAtIndex(), lldb_private::TypeCategoryMap::GetCount(), m_categories_map, and UINT32_MAX.
Referenced by lldb_private::DataVisualization::GetFilterForType().
lldb::TypeFormatImplSP FormatManager::GetFormat | ( | ValueObject & | valobj, |
lldb::DynamicValueType | use_dynamic | ||
) |
Definition at line 659 of file FormatManager.cpp.
References lldb_private::LanguageCategory::Get< lldb::TypeFormatImplSP >().
Referenced by lldb_private::DataVisualization::GetFormat().
|
static |
Definition at line 152 of file FormatManager.cpp.
References lldb::eFormatDefault, FormatInfo::format_name, g_format_infos, and lldb::kNumFormats.
Referenced by lldb_private::DynamicRegisterInfo::Dump(), lldb_private::FormatEntity::Entry::Dump(), lldb_private::OptionValueFormat::DumpValue(), DumpValue(), lldb_private::FormatHelpTextCallback(), lldb_private::TypeFormatImpl_Format::GetDescription(), lldb_private::OptionArgParser::ToFormat(), and lldb_private::OptionValueFormat::ToJSON().
|
static |
Definition at line 144 of file FormatManager.cpp.
References FormatInfo::format_char, g_format_infos, and g_num_format_infos.
Referenced by DumpValue(), lldb_private::FormatHelpTextCallback(), and lldb_private::OptionArgParser::ToFormat().
lldb::TypeFormatImplSP FormatManager::GetFormatForType | ( | lldb::TypeNameSpecifierImplSP | type_sp | ) |
Definition at line 295 of file FormatManager.cpp.
References GetCategoryAtIndex(), lldb_private::TypeCategoryMap::GetCount(), m_categories_map, and UINT32_MAX.
Referenced by lldb_private::DataVisualization::GetFormatForType().
|
static |
Definition at line 126 of file FormatManager.cpp.
References lldb::eFormatInvalid, GetFormatFromFormatChar(), and GetFormatFromFormatName().
Referenced by lldb_private::FormatEntity::ParseInternal(), and lldb_private::OptionArgParser::ToFormat().
|
private |
Definition at line 588 of file FormatManager.cpp.
References lldb_private::FormattersMatchData::GetCandidateLanguages(), and GetCategoryForLanguage().
|
inline |
Definition at line 48 of file FormatManager.h.
References m_named_summaries_map.
Referenced by lldb_private::DataVisualization::NamedSummaryFormats::Add(), lldb_private::DataVisualization::NamedSummaryFormats::Clear(), lldb_private::DataVisualization::NamedSummaryFormats::Delete(), lldb_private::DataVisualization::NamedSummaryFormats::ForEach(), lldb_private::DataVisualization::NamedSummaryFormats::GetCount(), and lldb_private::DataVisualization::NamedSummaryFormats::GetSummaryFormat().
|
staticprivate |
Definition at line 176 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().
|
inlinestatic |
Definition at line 163 of file FormatManager.h.
References lldb_private::ValueObject::GetCompilerType(), and GetPossibleMatches().
Referenced by lldb_private::FormattersMatchData::GetMatchesVector(), and GetPossibleMatches().
|
static |
Definition at line 419 of file FormatManager.cpp.
References lldb::eFormatCharArray, lldb::eFormatDecimal, lldb::eFormatFloat, lldb::eFormatHex, lldb::eFormatInvalid, lldb::eFormatVectorOfChar, lldb::eFormatVectorOfFloat16, lldb::eFormatVectorOfFloat32, lldb::eFormatVectorOfFloat64, lldb::eFormatVectorOfSInt16, lldb::eFormatVectorOfSInt32, lldb::eFormatVectorOfSInt64, lldb::eFormatVectorOfSInt8, lldb::eFormatVectorOfUInt128, lldb::eFormatVectorOfUInt16, lldb::eFormatVectorOfUInt32, lldb::eFormatVectorOfUInt64, and lldb::eFormatVectorOfUInt8.
Referenced by lldb_private::ValueObject::DumpPrintableRepresentation().
lldb::TypeSummaryImplSP FormatManager::GetSummaryFormat | ( | ValueObject & | valobj, |
lldb::DynamicValueType | use_dynamic | ||
) |
Definition at line 665 of file FormatManager.cpp.
References lldb_private::LanguageCategory::Get< lldb::TypeSummaryImplSP >().
Referenced by lldb_private::DataVisualization::GetSummaryFormat().
lldb::TypeSummaryImplSP FormatManager::GetSummaryForType | ( | lldb::TypeNameSpecifierImplSP | type_sp | ) |
Definition at line 319 of file FormatManager.cpp.
References GetCategoryAtIndex(), lldb_private::TypeCategoryMap::GetCount(), m_categories_map, and UINT32_MAX.
Referenced by lldb_private::DataVisualization::GetSummaryForType().
lldb::SyntheticChildrenSP FormatManager::GetSyntheticChildren | ( | ValueObject & | valobj, |
lldb::DynamicValueType | use_dynamic | ||
) |
Definition at line 671 of file FormatManager.cpp.
References lldb_private::LanguageCategory::Get< lldb::SyntheticChildrenSP >().
Referenced by lldb_private::DataVisualization::GetSyntheticChildren().
lldb::ScriptedSyntheticChildrenSP FormatManager::GetSyntheticForType | ( | lldb::TypeNameSpecifierImplSP | type_sp | ) |
Definition at line 367 of file FormatManager.cpp.
References GetCategoryAtIndex(), lldb_private::TypeCategoryMap::GetCount(), m_categories_map, and UINT32_MAX.
Referenced by lldb_private::DataVisualization::GetSyntheticForType().
|
static |
Definition at line 545 of file FormatManager.cpp.
References lldb_private::ValueObject::GetQualifiedRepresentationIfAvailable(), and lldb_private::ValueObject::IsSynthetic().
|
private |
Definition at line 691 of file FormatManager.cpp.
References lldb_private::formatters::AddFormat(), lldb::eFormatOSType, lldb::eFormatterMatchExact, lldb::eFormatterMatchRegex, GetCategory(), m_system_category_name, lldb_private::TypeFormatImpl::Flags::SetCascades(), lldb_private::TypeSummaryImpl::Flags::SetCascades(), lldb_private::TypeSummaryImpl::Flags::SetDontShowChildren(), lldb_private::TypeSummaryImpl::Flags::SetDontShowValue(), lldb_private::TypeSummaryImpl::Flags::SetHideItemNames(), lldb_private::TypeSummaryImpl::Flags::SetShowMembersOneLiner(), lldb_private::TypeFormatImpl::Flags::SetSkipPointers(), lldb_private::TypeSummaryImpl::Flags::SetSkipPointers(), lldb_private::TypeFormatImpl::Flags::SetSkipReferences(), and lldb_private::TypeSummaryImpl::Flags::SetSkipReferences().
Referenced by FormatManager().
|
private |
Definition at line 747 of file FormatManager.cpp.
References lldb_private::formatters::AddStringSummary(), GetCategory(), m_vectortypes_category_name, lldb_private::TypeSummaryImpl::Flags::SetCascades(), lldb_private::TypeSummaryImpl::Flags::SetDontShowChildren(), lldb_private::TypeSummaryImpl::Flags::SetDontShowValue(), lldb_private::TypeSummaryImpl::Flags::SetHideItemNames(), lldb_private::TypeSummaryImpl::Flags::SetShowMembersOneLiner(), lldb_private::TypeSummaryImpl::Flags::SetSkipPointers(), and lldb_private::TypeSummaryImpl::Flags::SetSkipReferences().
Referenced by FormatManager().
bool FormatManager::ShouldPrintAsOneLiner | ( | ValueObject & | valobj | ) |
Definition at line 447 of file FormatManager.cpp.
References lldb_private::eLazyBoolCalculate, lldb_private::eLazyBoolNo, lldb_private::eLazyBoolYes, lldb_private::ValueObject::GetChildAtIndex(), lldb_private::ValueObject::GetCompilerType(), lldb_private::ValueObject::GetNumChildren(), lldb_private::ValueObject::GetSummaryFormat(), lldb_private::ValueObject::GetTargetSP(), lldb_private::CompilerType::IsValid(), and lldb_private::CompilerType::ShouldPrintAsOneLiner().
Referenced by lldb_private::DataVisualization::ShouldPrintAsOneLiner().
|
friend |
Definition at line 213 of file FormatManager.h.
|
private |
Definition at line 190 of file FormatManager.h.
Referenced by AnyMatches(), ClearCategories(), DeleteCategory(), DisableAllCategories(), DisableCategory(), EnableAllCategories(), EnableCategory(), ForEachCategory(), GetCached(), GetCategories(), GetCategoriesCount(), GetCategory(), GetCategoryAtIndex(), GetFilterForType(), GetFormatForType(), GetSummaryForType(), and GetSyntheticForType().
|
private |
Definition at line 192 of file FormatManager.h.
Referenced by GetCategory().
|
private |
Definition at line 186 of file FormatManager.h.
Referenced by Changed(), and GetCached().
|
private |
Definition at line 188 of file FormatManager.h.
Referenced by Changed(), DisableAllCategories(), EnableAllCategories(), ForEachCategory(), and GetCategoryForLanguage().
|
private |
Definition at line 187 of file FormatManager.h.
Referenced by Changed(), DisableAllCategories(), EnableAllCategories(), ForEachCategory(), and GetCategoryForLanguage().
|
private |
Definition at line 185 of file FormatManager.h.
Referenced by Changed(), and GetCurrentRevision().
|
private |
Definition at line 189 of file FormatManager.h.
Referenced by GetNamedSummaryContainer().
|
private |
Definition at line 193 of file FormatManager.h.
Referenced by FormatManager(), and LoadSystemFormatters().
|
private |
Definition at line 194 of file FormatManager.h.
Referenced by FormatManager(), and LoadVectorFormatters().