LLDB mainline
DataVisualization.cpp
Go to the documentation of this file.
1//===-- DataVisualization.cpp ---------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
10
11
12using namespace lldb;
13using namespace lldb_private;
14
16 static FormatManager g_format_manager;
17 return g_format_manager;
18}
19
21
24}
25
28}
29
32 lldb::DynamicValueType use_dynamic) {
33 return GetFormatManager().GetFormat(valobj, use_dynamic);
34}
35
38 return GetFormatManager().GetFormatForType(type_sp);
39}
40
43 lldb::DynamicValueType use_dynamic) {
44 return GetFormatManager().GetSummaryFormat(valobj, use_dynamic);
45}
46
49 return GetFormatManager().GetSummaryForType(type_sp);
50}
51
54 lldb::DynamicValueType use_dynamic) {
55 return GetFormatManager().GetSyntheticChildren(valobj, use_dynamic);
56}
57
60 return GetFormatManager().GetFilterForType(type_sp);
61}
62
65 return GetFormatManager().GetSyntheticForType(type_sp);
66}
67
69 const FormattersMatchCandidate &candidate_type,
70 TypeCategoryImpl::FormatCategoryItems items, bool only_enabled,
71 const char **matching_category,
73 return GetFormatManager().AnyMatches(candidate_type, items, only_enabled,
74 matching_category, matching_type);
75}
76
79 bool allow_create) {
80 entry = GetFormatManager().GetCategory(category, allow_create);
81 return (entry.get() != nullptr);
82}
83
86 if (LanguageCategory *lang_category =
87 GetFormatManager().GetCategoryForLanguage(language))
88 entry = lang_category->GetCategory();
89 return (entry.get() != nullptr);
90}
91
93 GetFormatManager().GetCategory(category);
94}
95
98 return GetFormatManager().DeleteCategory(category);
99}
100
103}
104
107}
108
111 if (GetFormatManager().GetCategory(category)->IsEnabled())
113 GetFormatManager().EnableCategory(category, pos, {});
114}
115
117 if (LanguageCategory *lang_category =
118 GetFormatManager().GetCategoryForLanguage(lang_type))
119 lang_category->Enable();
120}
121
123 if (GetFormatManager().GetCategory(category)->IsEnabled())
125}
126
128 if (LanguageCategory *lang_category =
129 GetFormatManager().GetCategoryForLanguage(lang_type))
130 lang_category->Disable();
131}
132
135 if (category.get()) {
136 if (category->IsEnabled())
138 GetFormatManager().EnableCategory(category, pos);
139 }
140}
141
143 const lldb::TypeCategoryImplSP &category) {
144 if (category.get() && category->IsEnabled())
146}
147
150}
151
154}
155
159}
160
163}
164
167 return GetFormatManager().GetCategoryAtIndex(index);
168}
169
172 return GetFormatManager().GetNamedSummaryContainer().GetExact(type, entry);
173}
174
176 ConstString type, const lldb::TypeSummaryImplSP &entry) {
178}
179
182}
183
186}
187
189 std::function<bool(const TypeMatcher &, const lldb::TypeSummaryImplSP &)>
190 callback) {
192}
193
196}
static FormatManager & GetFormatManager()
A uniqued constant string class.
Definition: ConstString.h:40
static bool Delete(ConstString category)
static void Add(ConstString category)
static void Disable(ConstString category)
static lldb::TypeCategoryImplSP GetCategoryAtIndex(size_t)
static void ForEach(TypeCategoryMap::ForEachCallback callback)
static void Enable(ConstString category, TypeCategoryMap::Position=TypeCategoryMap::Default)
static bool GetCategory(ConstString category, lldb::TypeCategoryImplSP &entry, bool allow_create=true)
static void Add(ConstString type, const lldb::TypeSummaryImplSP &entry)
static bool GetSummaryFormat(ConstString type, lldb::TypeSummaryImplSP &entry)
static void ForEach(std::function< bool(const TypeMatcher &, const lldb::TypeSummaryImplSP &)> callback)
static lldb::ScriptedSyntheticChildrenSP GetSyntheticForType(lldb::TypeNameSpecifierImplSP type_sp)
static lldb::TypeFilterImplSP GetFilterForType(lldb::TypeNameSpecifierImplSP type_sp)
static bool ShouldPrintAsOneLiner(ValueObject &valobj)
static lldb::TypeSummaryImplSP GetSummaryFormat(ValueObject &valobj, lldb::DynamicValueType use_dynamic)
static lldb::TypeFormatImplSP GetFormat(ValueObject &valobj, lldb::DynamicValueType use_dynamic)
static lldb::TypeFormatImplSP GetFormatForType(lldb::TypeNameSpecifierImplSP type_sp)
static lldb::SyntheticChildrenSP GetSyntheticChildren(ValueObject &valobj, lldb::DynamicValueType use_dynamic)
static 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)
static lldb::TypeSummaryImplSP GetSummaryForType(lldb::TypeNameSpecifierImplSP type_sp)
NamedSummariesMap & GetNamedSummaryContainer()
Definition: FormatManager.h:48
void EnableCategory(ConstString category_name, TypeCategoryMap::Position pos=TypeCategoryMap::Default)
Definition: FormatManager.h:53
lldb::TypeFormatImplSP GetFormatForType(lldb::TypeNameSpecifierImplSP type_sp)
lldb::TypeFormatImplSP GetFormat(ValueObject &valobj, lldb::DynamicValueType use_dynamic)
lldb::TypeFilterImplSP GetFilterForType(lldb::TypeNameSpecifierImplSP type_sp)
bool ShouldPrintAsOneLiner(ValueObject &valobj)
lldb::TypeSummaryImplSP GetSummaryFormat(ValueObject &valobj, lldb::DynamicValueType use_dynamic)
lldb::TypeCategoryImplSP GetCategory(const char *category_name=nullptr, bool can_create=true)
Definition: FormatManager.h:99
void ForEachCategory(TypeCategoryMap::ForEachCallback callback)
lldb::ScriptedSyntheticChildrenSP GetSyntheticForType(lldb::TypeNameSpecifierImplSP type_sp)
bool DeleteCategory(ConstString category_name)
Definition: FormatManager.h:85
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)
lldb::TypeSummaryImplSP GetSummaryForType(lldb::TypeNameSpecifierImplSP type_sp)
lldb::SyntheticChildrenSP GetSyntheticChildren(ValueObject &valobj, lldb::DynamicValueType use_dynamic)
lldb::TypeCategoryImplSP GetCategoryAtIndex(size_t index)
Definition: FormatManager.h:93
uint32_t GetCurrentRevision() override
void DisableCategory(ConstString category_name)
Definition: FormatManager.h:67
void Add(TypeMatcher matcher, const ValueSP &entry)
bool Delete(TypeMatcher matcher)
bool GetExact(TypeMatcher matcher, ValueSP &entry)
void ForEach(ForEachCallback callback)
std::function< bool(const lldb::TypeCategoryImplSP &)> ForEachCallback
Class for matching type names.
A class that represents a running process on the host machine.
Definition: SBAddress.h:15
std::shared_ptr< lldb_private::TypeSummaryImpl > TypeSummaryImplSP
Definition: lldb-forward.h:471
std::shared_ptr< lldb_private::TypeFormatImpl > TypeFormatImplSP
Definition: lldb-forward.h:468
std::shared_ptr< lldb_private::TypeNameSpecifierImpl > TypeNameSpecifierImplSP
Definition: lldb-forward.h:470
LanguageType
Programming language type.
std::shared_ptr< lldb_private::SyntheticChildren > SyntheticChildrenSP
Definition: lldb-forward.h:441
std::shared_ptr< lldb_private::TypeCategoryImpl > TypeCategoryImplSP
Definition: lldb-forward.h:459
std::shared_ptr< lldb_private::ScriptedSyntheticChildren > ScriptedSyntheticChildrenSP
Definition: lldb-forward.h:474
std::shared_ptr< lldb_private::TypeFilterImpl > TypeFilterImplSP
Definition: lldb-forward.h:464