LLDB  mainline
DataVisualization.h
Go to the documentation of this file.
1 //===-- DataVisualization.h -------------------------------------*- C++ -*-===//
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 
9 #ifndef LLDB_DATAFORMATTERS_DATAVISUALIZATION_H
10 #define LLDB_DATAFORMATTERS_DATAVISUALIZATION_H
11 
15 
16 namespace lldb_private {
17 
18 // this class is the high-level front-end of LLDB Data Visualization code in
19 // FormatManager.h/cpp is the low-level implementation of this feature clients
20 // should refer to this class as the entry-point into the data formatters
21 // unless they have a good reason to bypass this and go to the backend
23 public:
24  // use this call to force the FM to consider itself updated even when there
25  // is no apparent reason for that
26  static void ForceUpdate();
27 
29 
30  static bool ShouldPrintAsOneLiner(ValueObject &valobj);
31 
32  static lldb::TypeFormatImplSP GetFormat(ValueObject &valobj,
33  lldb::DynamicValueType use_dynamic);
34 
35  static lldb::TypeFormatImplSP
36  GetFormatForType(lldb::TypeNameSpecifierImplSP type_sp);
37 
38  static lldb::TypeSummaryImplSP
40 
41  static lldb::TypeSummaryImplSP
42  GetSummaryForType(lldb::TypeNameSpecifierImplSP type_sp);
43 
44  static lldb::TypeFilterImplSP
45  GetFilterForType(lldb::TypeNameSpecifierImplSP type_sp);
46 
47  static lldb::ScriptedSyntheticChildrenSP
48  GetSyntheticForType(lldb::TypeNameSpecifierImplSP type_sp);
49 
50  static lldb::SyntheticChildrenSP
52 
53  static bool
54  AnyMatches(ConstString type_name,
57  bool only_enabled = true, const char **matching_category = nullptr,
58  TypeCategoryImpl::FormatCategoryItems *matching_type = nullptr);
59 
61  public:
62  static bool GetSummaryFormat(ConstString type,
63  lldb::TypeSummaryImplSP &entry);
64 
65  static void Add(ConstString type,
66  const lldb::TypeSummaryImplSP &entry);
67 
68  static bool Delete(ConstString type);
69 
70  static void Clear();
71 
72  static void ForEach(std::function<bool(const TypeMatcher &,
73  const lldb::TypeSummaryImplSP &)>
74  callback);
75 
76  static uint32_t GetCount();
77  };
78 
79  class Categories {
80  public:
81  static bool GetCategory(ConstString category,
82  lldb::TypeCategoryImplSP &entry,
83  bool allow_create = true);
84 
85  static bool GetCategory(lldb::LanguageType language,
86  lldb::TypeCategoryImplSP &entry);
87 
88  static void Add(ConstString category);
89 
90  static bool Delete(ConstString category);
91 
92  static void Clear();
93 
94  static void Clear(ConstString category);
95 
96  static void Enable(ConstString category,
98 
99  static void Enable(lldb::LanguageType lang_type);
100 
101  static void Disable(ConstString category);
102 
103  static void Disable(lldb::LanguageType lang_type);
104 
105  static void Enable(const lldb::TypeCategoryImplSP &category,
107 
108  static void Disable(const lldb::TypeCategoryImplSP &category);
109 
110  static void EnableStar();
111 
112  static void DisableStar();
113 
114  static void ForEach(TypeCategoryMap::ForEachCallback callback);
115 
116  static uint32_t GetCount();
117 
118  static lldb::TypeCategoryImplSP GetCategoryAtIndex(size_t);
119  };
120 };
121 
122 } // namespace lldb_private
123 
124 #endif // LLDB_DATAFORMATTERS_DATAVISUALIZATION_H
lldb_private::DataVisualization::Categories::Disable
static void Disable(ConstString category)
Definition: DataVisualization.cpp:122
lldb_private::DataVisualization::AnyMatches
static bool AnyMatches(ConstString type_name, TypeCategoryImpl::FormatCategoryItems items=TypeCategoryImpl::ALL_ITEM_TYPES, bool only_enabled=true, const char **matching_category=nullptr, TypeCategoryImpl::FormatCategoryItems *matching_type=nullptr)
Definition: DataVisualization.cpp:68
lldb_private::DataVisualization::Categories::GetCount
static uint32_t GetCount()
Definition: DataVisualization.cpp:161
lldb_private::TypeMatcher
Class for matching type names.
Definition: FormattersContainer.h:41
FormatClasses.h
lldb_private::DataVisualization::Categories::Add
static void Add(ConstString category)
Definition: DataVisualization.cpp:91
lldb_private::DataVisualization::Categories::GetCategory
static bool GetCategory(ConstString category, lldb::TypeCategoryImplSP &entry, bool allow_create=true)
Definition: DataVisualization.cpp:76
FormatManager.h
lldb_private::DataVisualization::GetCurrentRevision
static uint32_t GetCurrentRevision()
Definition: DataVisualization.cpp:22
lldb::LanguageType
LanguageType
Programming language type.
Definition: lldb-enumerations.h:436
lldb_private::DataVisualization::NamedSummaryFormats::GetCount
static uint32_t GetCount()
Definition: DataVisualization.cpp:194
lldb_private::TypeCategoryImpl::ALL_ITEM_TYPES
static const uint16_t ALL_ITEM_TYPES
Definition: TypeCategory.h:72
lldb_private::DataVisualization::GetSyntheticChildren
static lldb::SyntheticChildrenSP GetSyntheticChildren(ValueObject &valobj, lldb::DynamicValueType use_dynamic)
Definition: DataVisualization.cpp:53
lldb_private::DataVisualization::GetFormat
static lldb::TypeFormatImplSP GetFormat(ValueObject &valobj, lldb::DynamicValueType use_dynamic)
Definition: DataVisualization.cpp:31
lldb_private::DataVisualization::GetFormatForType
static lldb::TypeFormatImplSP GetFormatForType(lldb::TypeNameSpecifierImplSP type_sp)
Definition: DataVisualization.cpp:37
lldb_private::DataVisualization::ForceUpdate
static void ForceUpdate()
Definition: DataVisualization.cpp:20
lldb_private::DataVisualization::Categories::Delete
static bool Delete(ConstString category)
Definition: DataVisualization.cpp:95
lldb_private::DataVisualization::Categories::Enable
static void Enable(ConstString category, TypeCategoryMap::Position=TypeCategoryMap::Default)
Definition: DataVisualization.cpp:109
lldb_private::DataVisualization::NamedSummaryFormats::ForEach
static void ForEach(std::function< bool(const TypeMatcher &, const lldb::TypeSummaryImplSP &)> callback)
Definition: DataVisualization.cpp:188
lldb_private::DataVisualization
Definition: DataVisualization.h:22
lldb_private::DataVisualization::GetSyntheticForType
static lldb::ScriptedSyntheticChildrenSP GetSyntheticForType(lldb::TypeNameSpecifierImplSP type_sp)
Definition: DataVisualization.cpp:64
lldb_private::TypeCategoryMap::ForEachCallback
std::function< bool(const ValueSP &)> ForEachCallback
Definition: TypeCategoryMap.h:35
lldb_private::ConstString
Definition: ConstString.h:40
lldb_private::TypeCategoryMap::Default
static const Position Default
Definition: TypeCategoryMap.h:40
lldb_private::DataVisualization::NamedSummaryFormats::Delete
static bool Delete(ConstString type)
Definition: DataVisualization.cpp:180
lldb::DynamicValueType
DynamicValueType
Definition: lldb-enumerations.h:494
lldb_private::DataVisualization::NamedSummaryFormats::Add
static void Add(ConstString type, const lldb::TypeSummaryImplSP &entry)
Definition: DataVisualization.cpp:175
lldb_private::DataVisualization::Categories::Clear
static void Clear()
Definition: DataVisualization.cpp:100
lldb_private::DataVisualization::NamedSummaryFormats::GetSummaryFormat
static bool GetSummaryFormat(ConstString type, lldb::TypeSummaryImplSP &entry)
Definition: DataVisualization.cpp:170
lldb_private::DataVisualization::GetSummaryForType
static lldb::TypeSummaryImplSP GetSummaryForType(lldb::TypeNameSpecifierImplSP type_sp)
Definition: DataVisualization.cpp:48
lldb_private::ValueObject
ValueObject:
Definition: ValueObject.h:105
lldb_private::DataVisualization::GetFilterForType
static lldb::TypeFilterImplSP GetFilterForType(lldb::TypeNameSpecifierImplSP type_sp)
Definition: DataVisualization.cpp:59
uint32_t
lldb_private::DataVisualization::NamedSummaryFormats
Definition: DataVisualization.h:60
uint16_t
lldb_private::DataVisualization::Categories::ForEach
static void ForEach(TypeCategoryMap::ForEachCallback callback)
Definition: DataVisualization.cpp:156
lldb_private::DataVisualization::Categories::EnableStar
static void EnableStar()
Definition: DataVisualization.cpp:148
lldb_private::DataVisualization::Categories
Definition: DataVisualization.h:79
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::DataVisualization::Categories::GetCategoryAtIndex
static lldb::TypeCategoryImplSP GetCategoryAtIndex(size_t)
Definition: DataVisualization.cpp:166
ConstString.h
lldb_private::DataVisualization::Categories::DisableStar
static void DisableStar()
Definition: DataVisualization.cpp:152
lldb_private::DataVisualization::ShouldPrintAsOneLiner
static bool ShouldPrintAsOneLiner(ValueObject &valobj)
Definition: DataVisualization.cpp:26
lldb_private::DataVisualization::NamedSummaryFormats::Clear
static void Clear()
Definition: DataVisualization.cpp:184
lldb_private::DataVisualization::GetSummaryFormat
static lldb::TypeSummaryImplSP GetSummaryFormat(ValueObject &valobj, lldb::DynamicValueType use_dynamic)
Definition: DataVisualization.cpp:42