1 //===-- DumpValueObjectOptions.h --------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef lldb_DumpValueObjectOptions_h_
11 #define lldb_DumpValueObjectOptions_h_
17 // Other libraries and framework includes
19 #include "lldb/lldb-private.h"
20 #include "lldb/lldb-public.h"
25 namespace lldb_private {
27 class DumpValueObjectOptions {
30 enum class Mode { Always, Default, Never } m_mode;
33 PointerDepth operator--() const {
35 return PointerDepth{m_mode, m_count - 1};
36 return PointerDepth{m_mode, m_count};
39 bool CanAllowExpansion() const;
42 struct PointerAsArraySettings {
43 size_t m_element_count;
44 size_t m_base_element;
47 PointerAsArraySettings()
48 : m_element_count(0), m_base_element(0), m_stride() {}
50 PointerAsArraySettings(size_t elem_count, size_t base_elem = 0,
52 : m_element_count(elem_count), m_base_element(base_elem),
55 operator bool() { return m_element_count > 0; }
58 typedef std::function<bool(ConstString, ConstString,
59 const DumpValueObjectOptions &, Stream &)>
62 static const DumpValueObjectOptions DefaultOptions() {
63 static DumpValueObjectOptions g_default_options;
65 return g_default_options;
68 DumpValueObjectOptions();
70 DumpValueObjectOptions(const DumpValueObjectOptions &rhs) = default;
72 DumpValueObjectOptions(ValueObject &valobj);
74 DumpValueObjectOptions &
75 SetMaximumPointerDepth(PointerDepth depth = {PointerDepth::Mode::Never, 0});
77 DumpValueObjectOptions &SetMaximumDepth(uint32_t depth = 0);
79 DumpValueObjectOptions &SetDeclPrintingHelper(DeclPrintingHelper helper);
81 DumpValueObjectOptions &SetShowTypes(bool show = false);
83 DumpValueObjectOptions &SetShowLocation(bool show = false);
85 DumpValueObjectOptions &SetUseObjectiveC(bool use = false);
87 DumpValueObjectOptions &SetShowSummary(bool show = true);
89 DumpValueObjectOptions &
90 SetUseDynamicType(lldb::DynamicValueType dyn = lldb::eNoDynamicValues);
92 DumpValueObjectOptions &SetUseSyntheticValue(bool use_synthetic = true);
94 DumpValueObjectOptions &SetScopeChecked(bool check = true);
96 DumpValueObjectOptions &SetFlatOutput(bool flat = false);
98 DumpValueObjectOptions &SetOmitSummaryDepth(uint32_t depth = 0);
100 DumpValueObjectOptions &SetIgnoreCap(bool ignore = false);
102 DumpValueObjectOptions &SetRawDisplay();
104 DumpValueObjectOptions &SetFormat(lldb::Format format = lldb::eFormatDefault);
106 DumpValueObjectOptions &
107 SetSummary(lldb::TypeSummaryImplSP summary = lldb::TypeSummaryImplSP());
109 DumpValueObjectOptions &SetRootValueObjectName(const char *name = nullptr);
111 DumpValueObjectOptions &SetHideRootType(bool hide_root_type = false);
113 DumpValueObjectOptions &SetHideName(bool hide_name = false);
115 DumpValueObjectOptions &SetHideValue(bool hide_value = false);
117 DumpValueObjectOptions &SetHidePointerValue(bool hide = false);
119 DumpValueObjectOptions &SetVariableFormatDisplayLanguage(
120 lldb::LanguageType lang = lldb::eLanguageTypeUnknown);
122 DumpValueObjectOptions &SetRunValidator(bool run = true);
124 DumpValueObjectOptions &SetUseTypeDisplayName(bool dis = false);
126 DumpValueObjectOptions &SetAllowOnelinerMode(bool oneliner = false);
128 DumpValueObjectOptions &SetRevealEmptyAggregates(bool reveal = true);
130 DumpValueObjectOptions &SetElementCount(uint32_t element_count = 0);
132 DumpValueObjectOptions &
133 SetPointerAsArray(const PointerAsArraySettings &ptr_array);
136 uint32_t m_max_depth = UINT32_MAX;
137 lldb::DynamicValueType m_use_dynamic = lldb::eNoDynamicValues;
138 uint32_t m_omit_summary_depth = 0;
139 lldb::Format m_format = lldb::eFormatDefault;
140 lldb::TypeSummaryImplSP m_summary_sp;
141 std::string m_root_valobj_name;
142 lldb::LanguageType m_varformat_language = lldb::eLanguageTypeUnknown;
143 PointerDepth m_max_ptr_depth;
144 DeclPrintingHelper m_decl_printing_helper;
145 PointerAsArraySettings m_pointer_as_array;
146 bool m_use_synthetic : 1;
147 bool m_scope_already_checked : 1;
148 bool m_flat_output : 1;
149 bool m_ignore_cap : 1;
150 bool m_show_types : 1;
151 bool m_show_location : 1;
153 bool m_hide_root_type : 1;
154 bool m_hide_name : 1;
155 bool m_hide_value : 1;
156 bool m_run_validator : 1;
157 bool m_use_type_display_name : 1;
158 bool m_allow_oneliner_mode : 1;
159 bool m_hide_pointer_value : 1;
160 bool m_reveal_empty_aggregates : 1;
163 } // namespace lldb_private
165 #endif // lldb_DumpValueObjectOptions_h_