1 //===-- DumpValueObjectOptions.cpp -----------------------------------*- 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 #include "lldb/DataFormatters/DumpValueObjectOptions.h"
14 // Other libraries and framework includes
16 #include "lldb/Core/ValueObject.h"
19 using namespace lldb_private;
21 DumpValueObjectOptions::DumpValueObjectOptions() :
24 m_max_ptr_depth(PointerDepth{PointerDepth::Mode::Default,0}),
25 m_decl_printing_helper(),
26 m_use_synthetic(true),
27 m_scope_already_checked(false),
31 m_show_location(false),
33 m_hide_root_type(false),
36 m_run_validator(false),
37 m_use_type_display_name(true),
38 m_allow_oneliner_mode(true),
39 m_hide_pointer_value(false),
40 m_reveal_empty_aggregates(true)
44 DumpValueObjectOptions::DumpValueObjectOptions (ValueObject& valobj) :
45 DumpValueObjectOptions()
47 m_use_dynamic = valobj.GetDynamicValueType();
48 m_use_synthetic = valobj.IsSynthetic();
49 m_varformat_language = valobj.GetPreferredDisplayLanguage();
52 DumpValueObjectOptions&
53 DumpValueObjectOptions::SetMaximumPointerDepth(PointerDepth depth)
55 m_max_ptr_depth = depth;
59 DumpValueObjectOptions&
60 DumpValueObjectOptions::SetMaximumDepth(uint32_t depth)
66 DumpValueObjectOptions&
67 DumpValueObjectOptions::SetDeclPrintingHelper(DeclPrintingHelper helper)
69 m_decl_printing_helper = helper;
73 DumpValueObjectOptions&
74 DumpValueObjectOptions::SetShowTypes(bool show)
80 DumpValueObjectOptions&
81 DumpValueObjectOptions::SetShowLocation(bool show)
83 m_show_location = show;
87 DumpValueObjectOptions&
88 DumpValueObjectOptions::SetUseObjectiveC(bool use)
94 DumpValueObjectOptions&
95 DumpValueObjectOptions::SetShowSummary(bool show)
98 SetOmitSummaryDepth(UINT32_MAX);
100 SetOmitSummaryDepth(0);
104 DumpValueObjectOptions&
105 DumpValueObjectOptions::SetUseDynamicType(lldb::DynamicValueType dyn)
111 DumpValueObjectOptions&
112 DumpValueObjectOptions::SetUseSyntheticValue(bool use_synthetic)
114 m_use_synthetic = use_synthetic;
118 DumpValueObjectOptions&
119 DumpValueObjectOptions::SetScopeChecked(bool check)
121 m_scope_already_checked = check;
125 DumpValueObjectOptions&
126 DumpValueObjectOptions::SetFlatOutput(bool flat)
128 m_flat_output = flat;
132 DumpValueObjectOptions&
133 DumpValueObjectOptions::SetOmitSummaryDepth(uint32_t depth)
135 m_omit_summary_depth = depth;
139 DumpValueObjectOptions&
140 DumpValueObjectOptions::SetIgnoreCap(bool ignore)
142 m_ignore_cap = ignore;
146 DumpValueObjectOptions&
147 DumpValueObjectOptions::SetRawDisplay()
149 SetUseSyntheticValue(false);
150 SetOmitSummaryDepth(UINT32_MAX);
154 SetUseTypeDisplayName(false);
155 SetAllowOnelinerMode(false);
159 DumpValueObjectOptions&
160 DumpValueObjectOptions::SetFormat (lldb::Format format)
166 DumpValueObjectOptions&
167 DumpValueObjectOptions::SetSummary (lldb::TypeSummaryImplSP summary)
169 m_summary_sp = summary;
173 DumpValueObjectOptions&
174 DumpValueObjectOptions::SetRootValueObjectName (const char* name)
177 m_root_valobj_name.assign(name);
179 m_root_valobj_name.clear();
183 DumpValueObjectOptions&
184 DumpValueObjectOptions::SetHideRootType (bool hide_root_type)
186 m_hide_root_type = hide_root_type;
190 DumpValueObjectOptions&
191 DumpValueObjectOptions::SetHideName (bool hide_name)
193 m_hide_name = hide_name;
197 DumpValueObjectOptions&
198 DumpValueObjectOptions::SetHideValue (bool hide_value)
200 m_hide_value = hide_value;
204 DumpValueObjectOptions&
205 DumpValueObjectOptions::SetHidePointerValue (bool hide)
207 m_hide_pointer_value = hide;
211 DumpValueObjectOptions&
212 DumpValueObjectOptions::SetVariableFormatDisplayLanguage (lldb::LanguageType lang)
214 m_varformat_language = lang;
218 DumpValueObjectOptions&
219 DumpValueObjectOptions::SetRunValidator (bool run)
221 m_run_validator = run;
225 DumpValueObjectOptions&
226 DumpValueObjectOptions::SetUseTypeDisplayName (bool dis)
228 m_use_type_display_name = dis;
232 DumpValueObjectOptions&
233 DumpValueObjectOptions::SetAllowOnelinerMode (bool oneliner)
235 m_allow_oneliner_mode = oneliner;
239 DumpValueObjectOptions&
240 DumpValueObjectOptions::SetRevealEmptyAggregates (bool reveal)
242 m_reveal_empty_aggregates = reveal;