Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:42:46

0001 //===-- DataVisualization.h -------------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLDB_DATAFORMATTERS_DATAVISUALIZATION_H
0010 #define LLDB_DATAFORMATTERS_DATAVISUALIZATION_H
0011 
0012 #include "lldb/DataFormatters/FormatClasses.h"
0013 #include "lldb/DataFormatters/FormatManager.h"
0014 #include "lldb/Utility/ConstString.h"
0015 
0016 namespace lldb_private {
0017 
0018 // this class is the high-level front-end of LLDB Data Visualization code in
0019 // FormatManager.h/cpp is the low-level implementation of this feature clients
0020 // should refer to this class as the entry-point into the data formatters
0021 // unless they have a good reason to bypass this and go to the backend
0022 class DataVisualization {
0023 public:
0024   // use this call to force the FM to consider itself updated even when there
0025   // is no apparent reason for that
0026   static void ForceUpdate();
0027 
0028   static uint32_t GetCurrentRevision();
0029 
0030   static bool ShouldPrintAsOneLiner(ValueObject &valobj);
0031 
0032   static lldb::TypeFormatImplSP GetFormat(ValueObject &valobj,
0033                                           lldb::DynamicValueType use_dynamic);
0034 
0035   static lldb::TypeFormatImplSP
0036   GetFormatForType(lldb::TypeNameSpecifierImplSP type_sp);
0037 
0038   static lldb::TypeSummaryImplSP
0039   GetSummaryFormat(ValueObject &valobj, lldb::DynamicValueType use_dynamic);
0040 
0041   static lldb::TypeSummaryImplSP
0042   GetSummaryForType(lldb::TypeNameSpecifierImplSP type_sp);
0043 
0044   static lldb::TypeFilterImplSP
0045   GetFilterForType(lldb::TypeNameSpecifierImplSP type_sp);
0046 
0047   static lldb::ScriptedSyntheticChildrenSP
0048   GetSyntheticForType(lldb::TypeNameSpecifierImplSP type_sp);
0049 
0050   static lldb::SyntheticChildrenSP
0051   GetSyntheticChildren(ValueObject &valobj, lldb::DynamicValueType use_dynamic);
0052 
0053   static bool
0054   AnyMatches(const FormattersMatchCandidate &candidate_type,
0055              TypeCategoryImpl::FormatCategoryItems items =
0056                  TypeCategoryImpl::ALL_ITEM_TYPES,
0057              bool only_enabled = true, const char **matching_category = nullptr,
0058              TypeCategoryImpl::FormatCategoryItems *matching_type = nullptr);
0059 
0060   class NamedSummaryFormats {
0061   public:
0062     static bool GetSummaryFormat(ConstString type,
0063                                  lldb::TypeSummaryImplSP &entry);
0064 
0065     static void Add(ConstString type,
0066                     const lldb::TypeSummaryImplSP &entry);
0067 
0068     static bool Delete(ConstString type);
0069 
0070     static void Clear();
0071 
0072     static void ForEach(std::function<bool(const TypeMatcher &,
0073                                            const lldb::TypeSummaryImplSP &)>
0074                             callback);
0075 
0076     static uint32_t GetCount();
0077   };
0078 
0079   class Categories {
0080   public:
0081     static bool GetCategory(ConstString category,
0082                             lldb::TypeCategoryImplSP &entry,
0083                             bool allow_create = true);
0084 
0085     static bool GetCategory(lldb::LanguageType language,
0086                             lldb::TypeCategoryImplSP &entry);
0087 
0088     static void Add(ConstString category);
0089 
0090     static bool Delete(ConstString category);
0091 
0092     static void Clear();
0093 
0094     static void Clear(ConstString category);
0095 
0096     static void Enable(ConstString category,
0097                        TypeCategoryMap::Position = TypeCategoryMap::Default);
0098 
0099     static void Enable(lldb::LanguageType lang_type);
0100 
0101     static void Disable(ConstString category);
0102 
0103     static void Disable(lldb::LanguageType lang_type);
0104 
0105     static void Enable(const lldb::TypeCategoryImplSP &category,
0106                        TypeCategoryMap::Position = TypeCategoryMap::Default);
0107 
0108     static void Disable(const lldb::TypeCategoryImplSP &category);
0109 
0110     static void EnableStar();
0111 
0112     static void DisableStar();
0113 
0114     static void ForEach(TypeCategoryMap::ForEachCallback callback);
0115 
0116     static uint32_t GetCount();
0117 
0118     static lldb::TypeCategoryImplSP GetCategoryAtIndex(size_t);
0119   };
0120 };
0121 
0122 } // namespace lldb_private
0123 
0124 #endif // LLDB_DATAFORMATTERS_DATAVISUALIZATION_H