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_DataVisualization_h_
10 #define lldb_DataVisualization_h_
11 
12 
16 
17 namespace lldb_private {
18 
19 // this class is the high-level front-end of LLDB Data Visualization code in
20 // FormatManager.h/cpp is the low-level implementation of this feature clients
21 // should refer to this class as the entry-point into the data formatters
22 // unless they have a good reason to bypass this and go to the backend
24 public:
25  // use this call to force the FM to consider itself updated even when there
26  // is no apparent reason for that
27  static void ForceUpdate();
28 
30 
31  static bool ShouldPrintAsOneLiner(ValueObject &valobj);
32 
33  static lldb::TypeFormatImplSP GetFormat(ValueObject &valobj,
34  lldb::DynamicValueType use_dynamic);
35 
36  static lldb::TypeFormatImplSP
37  GetFormatForType(lldb::TypeNameSpecifierImplSP type_sp);
38 
39  static lldb::TypeSummaryImplSP
41 
42  static lldb::TypeSummaryImplSP
43  GetSummaryForType(lldb::TypeNameSpecifierImplSP type_sp);
44 
45  static lldb::TypeFilterImplSP
46  GetFilterForType(lldb::TypeNameSpecifierImplSP type_sp);
47 
48  static lldb::ScriptedSyntheticChildrenSP
49  GetSyntheticForType(lldb::TypeNameSpecifierImplSP type_sp);
50 
51  static lldb::SyntheticChildrenSP
53 
54  static lldb::TypeValidatorImplSP
55  GetValidator(ValueObject &valobj, lldb::DynamicValueType use_dynamic);
56 
57  static lldb::TypeValidatorImplSP
58  GetValidatorForType(lldb::TypeNameSpecifierImplSP type_sp);
59 
60  static bool
61  AnyMatches(ConstString type_name,
64  bool only_enabled = true, const char **matching_category = nullptr,
65  TypeCategoryImpl::FormatCategoryItems *matching_type = nullptr);
66 
68  public:
69  static bool GetSummaryFormat(ConstString type,
70  lldb::TypeSummaryImplSP &entry);
71 
72  static void Add(ConstString type,
73  const lldb::TypeSummaryImplSP &entry);
74 
75  static bool Delete(ConstString type);
76 
77  static void Clear();
78 
79  static void
80  ForEach(std::function<bool(ConstString, const lldb::TypeSummaryImplSP &)>
81  callback);
82 
83  static uint32_t GetCount();
84  };
85 
86  class Categories {
87  public:
88  static bool GetCategory(ConstString category,
89  lldb::TypeCategoryImplSP &entry,
90  bool allow_create = true);
91 
92  static bool GetCategory(lldb::LanguageType language,
93  lldb::TypeCategoryImplSP &entry);
94 
95  static void Add(ConstString category);
96 
97  static bool Delete(ConstString category);
98 
99  static void Clear();
100 
101  static void Clear(ConstString category);
102 
103  static void Enable(ConstString category,
105 
106  static void Enable(lldb::LanguageType lang_type);
107 
108  static void Disable(ConstString category);
109 
110  static void Disable(lldb::LanguageType lang_type);
111 
112  static void Enable(const lldb::TypeCategoryImplSP &category,
114 
115  static void Disable(const lldb::TypeCategoryImplSP &category);
116 
117  static void EnableStar();
118 
119  static void DisableStar();
120 
121  static void ForEach(TypeCategoryMap::ForEachCallback callback);
122 
123  static uint32_t GetCount();
124 
125  static lldb::TypeCategoryImplSP GetCategoryAtIndex(size_t);
126  };
127 };
128 
129 } // namespace lldb_private
130 
131 #endif // lldb_DataVisualization_h_
Enumerations for broadcasting.
Definition: SBLaunchInfo.h:14
static const uint16_t ALL_ITEM_TYPES
Definition: TypeCategory.h:75
static lldb::TypeFormatImplSP GetFormatForType(lldb::TypeNameSpecifierImplSP type_sp)
static void Add(ConstString type, const lldb::TypeSummaryImplSP &entry)
static lldb::TypeValidatorImplSP GetValidator(ValueObject &valobj, lldb::DynamicValueType use_dynamic)
static lldb::TypeFilterImplSP GetFilterForType(lldb::TypeNameSpecifierImplSP type_sp)
static const Position Default
static lldb::SyntheticChildrenSP GetSyntheticChildren(ValueObject &valobj, lldb::DynamicValueType use_dynamic)
static lldb::TypeFormatImplSP GetFormat(ValueObject &valobj, lldb::DynamicValueType use_dynamic)
static void ForEach(std::function< bool(ConstString, const lldb::TypeSummaryImplSP &)> callback)
static lldb::TypeSummaryImplSP GetSummaryForType(lldb::TypeNameSpecifierImplSP type_sp)
LanguageType
Programming language type.
std::function< bool(const ValueSP &)> ForEachCallback
static bool ShouldPrintAsOneLiner(ValueObject &valobj)
static lldb::TypeValidatorImplSP GetValidatorForType(lldb::TypeNameSpecifierImplSP type_sp)
static bool GetSummaryFormat(ConstString type, lldb::TypeSummaryImplSP &entry)
A uniqued constant string class.
Definition: ConstString.h:38
static lldb::ScriptedSyntheticChildrenSP GetSyntheticForType(lldb::TypeNameSpecifierImplSP type_sp)
static lldb::TypeSummaryImplSP GetSummaryFormat(ValueObject &valobj, lldb::DynamicValueType use_dynamic)
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)