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"
13 #include "lldb/Core/ValueObject.h"
16 using namespace lldb_private;
18 DumpValueObjectOptions::DumpValueObjectOptions()
19 : m_summary_sp(), m_root_valobj_name(),
20 m_max_ptr_depth(PointerDepth{PointerDepth::Mode::Default, 0}),
21 m_decl_printing_helper(), m_pointer_as_array(), m_use_synthetic(true),
22 m_scope_already_checked(false), m_flat_output(false), m_ignore_cap(false),
23 m_show_types(false), m_show_location(false), m_use_objc(false),
24 m_hide_root_type(false), m_hide_name(false), m_hide_value(false),
25 m_run_validator(false), m_use_type_display_name(true),
26 m_allow_oneliner_mode(true), m_hide_pointer_value(false),
27 m_reveal_empty_aggregates(true) {}
29 DumpValueObjectOptions::DumpValueObjectOptions(ValueObject &valobj)
30 : DumpValueObjectOptions() {
31 m_use_dynamic = valobj.GetDynamicValueType();
32 m_use_synthetic = valobj.IsSynthetic();
33 m_varformat_language = valobj.GetPreferredDisplayLanguage();
36 DumpValueObjectOptions &
37 DumpValueObjectOptions::SetMaximumPointerDepth(PointerDepth depth) {
38 m_max_ptr_depth = depth;
42 DumpValueObjectOptions &
43 DumpValueObjectOptions::SetMaximumDepth(uint32_t depth) {
48 DumpValueObjectOptions &
49 DumpValueObjectOptions::SetDeclPrintingHelper(DeclPrintingHelper helper) {
50 m_decl_printing_helper = helper;
54 DumpValueObjectOptions &DumpValueObjectOptions::SetShowTypes(bool show) {
59 DumpValueObjectOptions &DumpValueObjectOptions::SetShowLocation(bool show) {
60 m_show_location = show;
64 DumpValueObjectOptions &DumpValueObjectOptions::SetUseObjectiveC(bool use) {
69 DumpValueObjectOptions &DumpValueObjectOptions::SetShowSummary(bool show) {
71 SetOmitSummaryDepth(UINT32_MAX);
73 SetOmitSummaryDepth(0);
77 DumpValueObjectOptions &
78 DumpValueObjectOptions::SetUseDynamicType(lldb::DynamicValueType dyn) {
83 DumpValueObjectOptions &
84 DumpValueObjectOptions::SetUseSyntheticValue(bool use_synthetic) {
85 m_use_synthetic = use_synthetic;
89 DumpValueObjectOptions &DumpValueObjectOptions::SetScopeChecked(bool check) {
90 m_scope_already_checked = check;
94 DumpValueObjectOptions &DumpValueObjectOptions::SetFlatOutput(bool flat) {
99 DumpValueObjectOptions &
100 DumpValueObjectOptions::SetOmitSummaryDepth(uint32_t depth) {
101 m_omit_summary_depth = depth;
105 DumpValueObjectOptions &DumpValueObjectOptions::SetIgnoreCap(bool ignore) {
106 m_ignore_cap = ignore;
110 DumpValueObjectOptions &DumpValueObjectOptions::SetRawDisplay() {
111 SetUseSyntheticValue(false);
112 SetOmitSummaryDepth(UINT32_MAX);
116 SetUseTypeDisplayName(false);
117 SetAllowOnelinerMode(false);
121 DumpValueObjectOptions &DumpValueObjectOptions::SetFormat(lldb::Format format) {
126 DumpValueObjectOptions &
127 DumpValueObjectOptions::SetSummary(lldb::TypeSummaryImplSP summary) {
128 m_summary_sp = summary;
132 DumpValueObjectOptions &
133 DumpValueObjectOptions::SetRootValueObjectName(const char *name) {
135 m_root_valobj_name.assign(name);
137 m_root_valobj_name.clear();
141 DumpValueObjectOptions &
142 DumpValueObjectOptions::SetHideRootType(bool hide_root_type) {
143 m_hide_root_type = hide_root_type;
147 DumpValueObjectOptions &DumpValueObjectOptions::SetHideName(bool hide_name) {
148 m_hide_name = hide_name;
152 DumpValueObjectOptions &DumpValueObjectOptions::SetHideValue(bool hide_value) {
153 m_hide_value = hide_value;
157 DumpValueObjectOptions &DumpValueObjectOptions::SetHidePointerValue(bool hide) {
158 m_hide_pointer_value = hide;
162 DumpValueObjectOptions &
163 DumpValueObjectOptions::SetVariableFormatDisplayLanguage(
164 lldb::LanguageType lang) {
165 m_varformat_language = lang;
169 DumpValueObjectOptions &DumpValueObjectOptions::SetRunValidator(bool run) {
170 m_run_validator = run;
174 DumpValueObjectOptions &
175 DumpValueObjectOptions::SetUseTypeDisplayName(bool dis) {
176 m_use_type_display_name = dis;
180 DumpValueObjectOptions &
181 DumpValueObjectOptions::SetAllowOnelinerMode(bool oneliner) {
182 m_allow_oneliner_mode = oneliner;
186 DumpValueObjectOptions &
187 DumpValueObjectOptions::SetRevealEmptyAggregates(bool reveal) {
188 m_reveal_empty_aggregates = reveal;
192 DumpValueObjectOptions &
193 DumpValueObjectOptions::SetElementCount(uint32_t element_count) {
194 m_pointer_as_array = PointerAsArraySettings(element_count);
198 DumpValueObjectOptions &DumpValueObjectOptions::SetPointerAsArray(
199 const PointerAsArraySettings &ptr_array) {
200 m_pointer_as_array = ptr_array;