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_
15 #include "lldb/lldb-private.h"
16 #include "lldb/lldb-public.h"
21 namespace lldb_private {
23 class DumpValueObjectOptions {
26 enum class Mode { Always, Default, Never } m_mode;
29 PointerDepth operator--() const {
31 return PointerDepth{m_mode, m_count - 1};
32 return PointerDepth{m_mode, m_count};
35 bool CanAllowExpansion() const;
38 struct PointerAsArraySettings {
39 size_t m_element_count;
40 size_t m_base_element;
43 PointerAsArraySettings()
44 : m_element_count(0), m_base_element(0), m_stride() {}
46 PointerAsArraySettings(size_t elem_count, size_t base_elem = 0,
48 : m_element_count(elem_count), m_base_element(base_elem),
51 operator bool() { return m_element_count > 0; }
54 typedef std::function<bool(ConstString, ConstString,
55 const DumpValueObjectOptions &, Stream &)>
58 static const DumpValueObjectOptions DefaultOptions() {
59 static DumpValueObjectOptions g_default_options;
61 return g_default_options;
64 DumpValueObjectOptions();
66 DumpValueObjectOptions(const DumpValueObjectOptions &rhs) = default;
68 DumpValueObjectOptions(ValueObject &valobj);
70 DumpValueObjectOptions &
71 SetMaximumPointerDepth(PointerDepth depth = {PointerDepth::Mode::Never, 0});
73 DumpValueObjectOptions &SetMaximumDepth(uint32_t depth = 0);
75 DumpValueObjectOptions &SetDeclPrintingHelper(DeclPrintingHelper helper);
77 DumpValueObjectOptions &SetShowTypes(bool show = false);
79 DumpValueObjectOptions &SetShowLocation(bool show = false);
81 DumpValueObjectOptions &SetUseObjectiveC(bool use = false);
83 DumpValueObjectOptions &SetShowSummary(bool show = true);
85 DumpValueObjectOptions &
86 SetUseDynamicType(lldb::DynamicValueType dyn = lldb::eNoDynamicValues);
88 DumpValueObjectOptions &SetUseSyntheticValue(bool use_synthetic = true);
90 DumpValueObjectOptions &SetScopeChecked(bool check = true);
92 DumpValueObjectOptions &SetFlatOutput(bool flat = false);
94 DumpValueObjectOptions &SetOmitSummaryDepth(uint32_t depth = 0);
96 DumpValueObjectOptions &SetIgnoreCap(bool ignore = false);
98 DumpValueObjectOptions &SetRawDisplay();
100 DumpValueObjectOptions &SetFormat(lldb::Format format = lldb::eFormatDefault);
102 DumpValueObjectOptions &
103 SetSummary(lldb::TypeSummaryImplSP summary = lldb::TypeSummaryImplSP());
105 DumpValueObjectOptions &SetRootValueObjectName(const char *name = nullptr);
107 DumpValueObjectOptions &SetHideRootType(bool hide_root_type = false);
109 DumpValueObjectOptions &SetHideName(bool hide_name = false);
111 DumpValueObjectOptions &SetHideValue(bool hide_value = false);
113 DumpValueObjectOptions &SetHidePointerValue(bool hide = false);
115 DumpValueObjectOptions &SetVariableFormatDisplayLanguage(
116 lldb::LanguageType lang = lldb::eLanguageTypeUnknown);
118 DumpValueObjectOptions &SetRunValidator(bool run = true);
120 DumpValueObjectOptions &SetUseTypeDisplayName(bool dis = false);
122 DumpValueObjectOptions &SetAllowOnelinerMode(bool oneliner = false);
124 DumpValueObjectOptions &SetRevealEmptyAggregates(bool reveal = true);
126 DumpValueObjectOptions &SetElementCount(uint32_t element_count = 0);
128 DumpValueObjectOptions &
129 SetPointerAsArray(const PointerAsArraySettings &ptr_array);
132 uint32_t m_max_depth = UINT32_MAX;
133 lldb::DynamicValueType m_use_dynamic = lldb::eNoDynamicValues;
134 uint32_t m_omit_summary_depth = 0;
135 lldb::Format m_format = lldb::eFormatDefault;
136 lldb::TypeSummaryImplSP m_summary_sp;
137 std::string m_root_valobj_name;
138 lldb::LanguageType m_varformat_language = lldb::eLanguageTypeUnknown;
139 PointerDepth m_max_ptr_depth;
140 DeclPrintingHelper m_decl_printing_helper;
141 PointerAsArraySettings m_pointer_as_array;
142 bool m_use_synthetic : 1;
143 bool m_scope_already_checked : 1;
144 bool m_flat_output : 1;
145 bool m_ignore_cap : 1;
146 bool m_show_types : 1;
147 bool m_show_location : 1;
149 bool m_hide_root_type : 1;
150 bool m_hide_name : 1;
151 bool m_hide_value : 1;
152 bool m_run_validator : 1;
153 bool m_use_type_display_name : 1;
154 bool m_allow_oneliner_mode : 1;
155 bool m_hide_pointer_value : 1;
156 bool m_reveal_empty_aggregates : 1;
159 } // namespace lldb_private
161 #endif // lldb_DumpValueObjectOptions_h_