1 //===-- DumpValueObjectOptions.cpp -----------------------------------*- C++
4 // The LLVM Compiler Infrastructure
6 // This file is distributed under the University of Illinois Open Source
7 // License. See LICENSE.TXT for details.
9 //===----------------------------------------------------------------------===//
11 #include "lldb/DataFormatters/DumpValueObjectOptions.h"
15 // Other libraries and framework includes
17 #include "lldb/Core/ValueObject.h"
20 using namespace lldb_private;
22 DumpValueObjectOptions::DumpValueObjectOptions()
23 : m_summary_sp(), m_root_valobj_name(),
24 m_max_ptr_depth(PointerDepth{PointerDepth::Mode::Default, 0}),
25 m_decl_printing_helper(), m_pointer_as_array(), m_use_synthetic(true),
26 m_scope_already_checked(false), m_flat_output(false), m_ignore_cap(false),
27 m_show_types(false), m_show_location(false), m_use_objc(false),
28 m_hide_root_type(false), m_hide_name(false), m_hide_value(false),
29 m_run_validator(false), m_use_type_display_name(true),
30 m_allow_oneliner_mode(true), m_hide_pointer_value(false),
31 m_reveal_empty_aggregates(true) {}
33 DumpValueObjectOptions::DumpValueObjectOptions(ValueObject &valobj)
34 : DumpValueObjectOptions() {
35 m_use_dynamic = valobj.GetDynamicValueType();
36 m_use_synthetic = valobj.IsSynthetic();
37 m_varformat_language = valobj.GetPreferredDisplayLanguage();
40 DumpValueObjectOptions &
41 DumpValueObjectOptions::SetMaximumPointerDepth(PointerDepth depth) {
42 m_max_ptr_depth = depth;
46 DumpValueObjectOptions &
47 DumpValueObjectOptions::SetMaximumDepth(uint32_t depth) {
52 DumpValueObjectOptions &
53 DumpValueObjectOptions::SetDeclPrintingHelper(DeclPrintingHelper helper) {
54 m_decl_printing_helper = helper;
58 DumpValueObjectOptions &DumpValueObjectOptions::SetShowTypes(bool show) {
63 DumpValueObjectOptions &DumpValueObjectOptions::SetShowLocation(bool show) {
64 m_show_location = show;
68 DumpValueObjectOptions &DumpValueObjectOptions::SetUseObjectiveC(bool use) {
73 DumpValueObjectOptions &DumpValueObjectOptions::SetShowSummary(bool show) {
75 SetOmitSummaryDepth(UINT32_MAX);
77 SetOmitSummaryDepth(0);
81 DumpValueObjectOptions &
82 DumpValueObjectOptions::SetUseDynamicType(lldb::DynamicValueType dyn) {
87 DumpValueObjectOptions &
88 DumpValueObjectOptions::SetUseSyntheticValue(bool use_synthetic) {
89 m_use_synthetic = use_synthetic;
93 DumpValueObjectOptions &DumpValueObjectOptions::SetScopeChecked(bool check) {
94 m_scope_already_checked = check;
98 DumpValueObjectOptions &DumpValueObjectOptions::SetFlatOutput(bool flat) {
103 DumpValueObjectOptions &
104 DumpValueObjectOptions::SetOmitSummaryDepth(uint32_t depth) {
105 m_omit_summary_depth = depth;
109 DumpValueObjectOptions &DumpValueObjectOptions::SetIgnoreCap(bool ignore) {
110 m_ignore_cap = ignore;
114 DumpValueObjectOptions &DumpValueObjectOptions::SetRawDisplay() {
115 SetUseSyntheticValue(false);
116 SetOmitSummaryDepth(UINT32_MAX);
120 SetUseTypeDisplayName(false);
121 SetAllowOnelinerMode(false);
125 DumpValueObjectOptions &DumpValueObjectOptions::SetFormat(lldb::Format format) {
130 DumpValueObjectOptions &
131 DumpValueObjectOptions::SetSummary(lldb::TypeSummaryImplSP summary) {
132 m_summary_sp = summary;
136 DumpValueObjectOptions &
137 DumpValueObjectOptions::SetRootValueObjectName(const char *name) {
139 m_root_valobj_name.assign(name);
141 m_root_valobj_name.clear();
145 DumpValueObjectOptions &
146 DumpValueObjectOptions::SetHideRootType(bool hide_root_type) {
147 m_hide_root_type = hide_root_type;
151 DumpValueObjectOptions &DumpValueObjectOptions::SetHideName(bool hide_name) {
152 m_hide_name = hide_name;
156 DumpValueObjectOptions &DumpValueObjectOptions::SetHideValue(bool hide_value) {
157 m_hide_value = hide_value;
161 DumpValueObjectOptions &DumpValueObjectOptions::SetHidePointerValue(bool hide) {
162 m_hide_pointer_value = hide;
166 DumpValueObjectOptions &
167 DumpValueObjectOptions::SetVariableFormatDisplayLanguage(
168 lldb::LanguageType lang) {
169 m_varformat_language = lang;
173 DumpValueObjectOptions &DumpValueObjectOptions::SetRunValidator(bool run) {
174 m_run_validator = run;
178 DumpValueObjectOptions &
179 DumpValueObjectOptions::SetUseTypeDisplayName(bool dis) {
180 m_use_type_display_name = dis;
184 DumpValueObjectOptions &
185 DumpValueObjectOptions::SetAllowOnelinerMode(bool oneliner) {
186 m_allow_oneliner_mode = oneliner;
190 DumpValueObjectOptions &
191 DumpValueObjectOptions::SetRevealEmptyAggregates(bool reveal) {
192 m_reveal_empty_aggregates = reveal;
196 DumpValueObjectOptions &
197 DumpValueObjectOptions::SetElementCount(uint32_t element_count) {
198 m_pointer_as_array = PointerAsArraySettings(element_count);
202 DumpValueObjectOptions &DumpValueObjectOptions::SetPointerAsArray(
203 const PointerAsArraySettings &ptr_array) {
204 m_pointer_as_array = ptr_array;