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
16namespace 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
23public:
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(const FormattersMatchCandidate &candidate_type,
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
A uniqued constant string class.
Definition: ConstString.h:39
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)
static const uint16_t ALL_ITEM_TYPES
Definition: TypeCategory.h:176
std::function< bool(const ValueSP &)> ForEachCallback
static const Position Default
Class for matching type names.
A class that represents a running process on the host machine.
LanguageType
Programming language type.