]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - include/lldb/DataFormatters/DumpValueObjectOptions.h
Vendor import of lldb release_39 branch r276489:
[FreeBSD/FreeBSD.git] / include / lldb / DataFormatters / DumpValueObjectOptions.h
1 //===-- DumpValueObjectOptions.h --------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef lldb_DumpValueObjectOptions_h_
11 #define lldb_DumpValueObjectOptions_h_
12
13 // C Includes
14 // C++ Includes
15 #include <string>
16
17 // Other libraries and framework includes
18 // Project includes
19 #include "lldb/lldb-private.h"
20 #include "lldb/lldb-public.h"
21
22 #include <functional>
23 #include <string>
24
25 namespace lldb_private {
26     
27 class DumpValueObjectOptions
28 {
29 public:
30     struct PointerDepth
31     {
32         enum class Mode
33         {
34             Always,
35             Formatters,
36             Default,
37             Never
38         } m_mode;
39         uint32_t m_count;
40         
41         PointerDepth
42         operator --() const
43         {
44             if (m_count > 0)
45                 return PointerDepth {m_mode,m_count-1};
46             return PointerDepth {m_mode,m_count};
47         }
48         
49         bool
50         CanAllowExpansion () const;
51         
52         bool
53         CanAllowExpansion (bool is_root,
54                            TypeSummaryImpl* entry,
55                            ValueObject *valobj,
56                            const std::string& summary);
57     };
58     
59     typedef std::function<bool(ConstString,
60                                ConstString,
61                                const DumpValueObjectOptions &,
62                                Stream&)> DeclPrintingHelper;
63     
64     static const DumpValueObjectOptions
65     DefaultOptions()
66     {
67         static DumpValueObjectOptions g_default_options;
68         
69         return g_default_options;
70     }
71     
72     DumpValueObjectOptions();
73     
74     DumpValueObjectOptions (const DumpValueObjectOptions& rhs) = default;
75     
76     DumpValueObjectOptions (ValueObject& valobj);
77     
78     DumpValueObjectOptions&
79     SetMaximumPointerDepth(PointerDepth depth = {PointerDepth::Mode::Never,0});
80     
81     DumpValueObjectOptions&
82     SetMaximumDepth(uint32_t depth = 0);
83     
84     DumpValueObjectOptions&
85     SetDeclPrintingHelper(DeclPrintingHelper helper);
86     
87     DumpValueObjectOptions&
88     SetShowTypes(bool show = false);
89     
90     DumpValueObjectOptions&
91     SetShowLocation(bool show = false);
92     
93     DumpValueObjectOptions&
94     SetUseObjectiveC(bool use = false);
95     
96     DumpValueObjectOptions&
97     SetShowSummary(bool show = true);
98     
99     DumpValueObjectOptions&
100     SetUseDynamicType(lldb::DynamicValueType dyn = lldb::eNoDynamicValues);
101     
102     DumpValueObjectOptions&
103     SetUseSyntheticValue(bool use_synthetic = true);
104     
105     DumpValueObjectOptions&
106     SetScopeChecked(bool check = true);
107     
108     DumpValueObjectOptions&
109     SetFlatOutput(bool flat = false);
110     
111     DumpValueObjectOptions&
112     SetOmitSummaryDepth(uint32_t depth = 0);
113     
114     DumpValueObjectOptions&
115     SetIgnoreCap(bool ignore = false);
116     
117     DumpValueObjectOptions&
118     SetRawDisplay();
119     
120     DumpValueObjectOptions&
121     SetFormat (lldb::Format format = lldb::eFormatDefault);
122     
123     DumpValueObjectOptions&
124     SetSummary (lldb::TypeSummaryImplSP summary = lldb::TypeSummaryImplSP());
125     
126     DumpValueObjectOptions&
127     SetRootValueObjectName(const char* name = nullptr);
128     
129     DumpValueObjectOptions&
130     SetHideRootType (bool hide_root_type = false);
131     
132     DumpValueObjectOptions&
133     SetHideName (bool hide_name = false);
134     
135     DumpValueObjectOptions&
136     SetHideValue (bool hide_value = false);
137     
138     DumpValueObjectOptions&
139     SetHidePointerValue (bool hide = false);
140     
141     DumpValueObjectOptions&
142     SetVariableFormatDisplayLanguage (lldb::LanguageType lang = lldb::eLanguageTypeUnknown);
143     
144     DumpValueObjectOptions&
145     SetRunValidator (bool run = true);
146     
147     DumpValueObjectOptions&
148     SetUseTypeDisplayName (bool dis = false);
149
150     DumpValueObjectOptions&
151     SetAllowOnelinerMode (bool oneliner = false);    
152
153     DumpValueObjectOptions&
154     SetRevealEmptyAggregates (bool reveal = true);
155     
156     DumpValueObjectOptions&
157     SetElementCount (uint32_t element_count = 0);
158
159 public:
160     uint32_t m_max_depth = UINT32_MAX;
161     lldb::DynamicValueType m_use_dynamic = lldb::eNoDynamicValues;
162     uint32_t m_omit_summary_depth = 0;
163     lldb::Format m_format = lldb::eFormatDefault;
164     lldb::TypeSummaryImplSP m_summary_sp;
165     std::string m_root_valobj_name;
166     lldb::LanguageType m_varformat_language = lldb::eLanguageTypeUnknown;
167     PointerDepth m_max_ptr_depth;
168     DeclPrintingHelper m_decl_printing_helper;
169     uint32_t m_element_count = 0;
170     bool m_use_synthetic : 1;
171     bool m_scope_already_checked : 1;
172     bool m_flat_output : 1;
173     bool m_ignore_cap : 1;
174     bool m_show_types : 1;
175     bool m_show_location : 1;
176     bool m_use_objc : 1;
177     bool m_hide_root_type : 1;
178     bool m_hide_name : 1;
179     bool m_hide_value : 1;
180     bool m_run_validator : 1;
181     bool m_use_type_display_name : 1;
182     bool m_allow_oneliner_mode : 1;
183     bool m_hide_pointer_value : 1;
184     bool m_reveal_empty_aggregates : 1;
185 };
186
187 } // namespace lldb_private
188
189 #endif // lldb_DumpValueObjectOptions_h_