LLDB  mainline
DumpValueObjectOptions.cpp
Go to the documentation of this file.
1 //===-- DumpValueObjectOptions.cpp ----------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
10 
11 #include "lldb/Core/ValueObject.h"
12 
13 using namespace lldb;
14 using namespace lldb_private;
15 
16 DumpValueObjectOptions::DumpValueObjectOptions()
17  : m_summary_sp(), m_root_valobj_name(),
18  m_max_ptr_depth(PointerDepth{PointerDepth::Mode::Default, 0}),
19  m_decl_printing_helper(), m_pointer_as_array(), m_use_synthetic(true),
20  m_scope_already_checked(false), m_flat_output(false), m_ignore_cap(false),
21  m_show_types(false), m_show_location(false), m_use_objc(false),
22  m_hide_root_type(false), m_hide_name(false), m_hide_value(false),
23  m_run_validator(false), m_use_type_display_name(true),
24  m_allow_oneliner_mode(true), m_hide_pointer_value(false),
25  m_reveal_empty_aggregates(true) {}
26 
30  m_use_synthetic = valobj.IsSynthetic();
32 }
33 
36  m_max_ptr_depth = depth;
37  return *this;
38 }
39 
42  m_max_depth = depth;
43  m_max_depth_is_default = is_default;
44  return *this;
45 }
46 
49  m_decl_printing_helper = helper;
50  return *this;
51 }
52 
54  m_show_types = show;
55  return *this;
56 }
57 
59  m_show_location = show;
60  return *this;
61 }
62 
64  m_use_objc = use;
65  return *this;
66 }
67 
69  if (!show)
71  else
73  return *this;
74 }
75 
78  m_use_dynamic = dyn;
79  return *this;
80 }
81 
84  m_use_synthetic = use_synthetic;
85  return *this;
86 }
87 
90  return *this;
91 }
92 
94  m_flat_output = flat;
95  return *this;
96 }
97 
100  m_omit_summary_depth = depth;
101  return *this;
102 }
103 
105  m_ignore_cap = ignore;
106  return *this;
107 }
108 
110  SetUseSyntheticValue(false);
112  SetIgnoreCap(true);
113  SetHideName(false);
114  SetHideValue(false);
115  SetUseTypeDisplayName(false);
116  SetAllowOnelinerMode(false);
117  return *this;
118 }
119 
121  m_format = format;
122  return *this;
123 }
124 
126 DumpValueObjectOptions::SetSummary(lldb::TypeSummaryImplSP summary) {
127  m_summary_sp = summary;
128  return *this;
129 }
130 
133  if (name)
134  m_root_valobj_name.assign(name);
135  else
136  m_root_valobj_name.clear();
137  return *this;
138 }
139 
142  m_hide_root_type = hide_root_type;
143  return *this;
144 }
145 
147  m_hide_name = hide_name;
148  return *this;
149 }
150 
152  m_hide_value = hide_value;
153  return *this;
154 }
155 
157  m_hide_pointer_value = hide;
158  return *this;
159 }
160 
163  lldb::LanguageType lang) {
164  m_varformat_language = lang;
165  return *this;
166 }
167 
169  m_run_validator = run;
170  return *this;
171 }
172 
176  return *this;
177 }
178 
181  m_allow_oneliner_mode = oneliner;
182  return *this;
183 }
184 
187  m_reveal_empty_aggregates = reveal;
188  return *this;
189 }
190 
194  return *this;
195 }
196 
198  const PointerAsArraySettings &ptr_array) {
199  m_pointer_as_array = ptr_array;
200  return *this;
201 }
lldb_private::DumpValueObjectOptions::SetFormat
DumpValueObjectOptions & SetFormat(lldb::Format format=lldb::eFormatDefault)
Definition: DumpValueObjectOptions.cpp:120
lldb_private::DumpValueObjectOptions::m_flat_output
bool m_flat_output
Definition: DumpValueObjectOptions.h:140
lldb_private::DumpValueObjectOptions::SetMaximumPointerDepth
DumpValueObjectOptions & SetMaximumPointerDepth(PointerDepth depth={PointerDepth::Mode::Never, 0})
Definition: DumpValueObjectOptions.cpp:35
lldb_private::DumpValueObjectOptions::m_use_type_display_name
bool m_use_type_display_name
Definition: DumpValueObjectOptions.h:149
lldb_private::DumpValueObjectOptions::m_hide_root_type
bool m_hide_root_type
Definition: DumpValueObjectOptions.h:145
lldb_private::DumpValueObjectOptions::DeclPrintingHelper
std::function< bool(ConstString, ConstString, const DumpValueObjectOptions &, Stream &)> DeclPrintingHelper
Definition: DumpValueObjectOptions.h:54
lldb_private::DumpValueObjectOptions::SetHideRootType
DumpValueObjectOptions & SetHideRootType(bool hide_root_type=false)
Definition: DumpValueObjectOptions.cpp:141
lldb::Format
Format
Display format definitions.
Definition: lldb-enumerations.h:155
lldb_private::DumpValueObjectOptions::m_summary_sp
lldb::TypeSummaryImplSP m_summary_sp
Definition: DumpValueObjectOptions.h:132
lldb_private::ValueObject::IsSynthetic
virtual bool IsSynthetic()
Definition: ValueObject.h:598
lldb_private::DumpValueObjectOptions::m_varformat_language
lldb::LanguageType m_varformat_language
Definition: DumpValueObjectOptions.h:134
lldb_private::DumpValueObjectOptions::SetDeclPrintingHelper
DumpValueObjectOptions & SetDeclPrintingHelper(DeclPrintingHelper helper)
Definition: DumpValueObjectOptions.cpp:48
lldb_private::DumpValueObjectOptions::SetUseDynamicType
DumpValueObjectOptions & SetUseDynamicType(lldb::DynamicValueType dyn=lldb::eNoDynamicValues)
Definition: DumpValueObjectOptions.cpp:77
lldb_private::DumpValueObjectOptions::m_scope_already_checked
bool m_scope_already_checked
Definition: DumpValueObjectOptions.h:139
lldb_private::DumpValueObjectOptions::m_omit_summary_depth
uint32_t m_omit_summary_depth
Definition: DumpValueObjectOptions.h:130
lldb_private::DumpValueObjectOptions::m_hide_name
bool m_hide_name
Definition: DumpValueObjectOptions.h:146
lldb::LanguageType
LanguageType
Programming language type.
Definition: lldb-enumerations.h:436
lldb_private::DumpValueObjectOptions::SetShowTypes
DumpValueObjectOptions & SetShowTypes(bool show=false)
Definition: DumpValueObjectOptions.cpp:53
lldb_private::DumpValueObjectOptions::SetOmitSummaryDepth
DumpValueObjectOptions & SetOmitSummaryDepth(uint32_t depth=0)
Definition: DumpValueObjectOptions.cpp:99
lldb_private::DumpValueObjectOptions::SetRevealEmptyAggregates
DumpValueObjectOptions & SetRevealEmptyAggregates(bool reveal=true)
Definition: DumpValueObjectOptions.cpp:186
lldb_private::DumpValueObjectOptions::SetAllowOnelinerMode
DumpValueObjectOptions & SetAllowOnelinerMode(bool oneliner=false)
Definition: DumpValueObjectOptions.cpp:180
lldb_private::DumpValueObjectOptions::DumpValueObjectOptions
DumpValueObjectOptions()
Definition: DumpValueObjectOptions.cpp:16
lldb_private::DumpValueObjectOptions::m_format
lldb::Format m_format
Definition: DumpValueObjectOptions.h:131
lldb_private::DumpValueObjectOptions::m_use_synthetic
bool m_use_synthetic
Definition: DumpValueObjectOptions.h:138
lldb_private::DumpValueObjectOptions::SetUseTypeDisplayName
DumpValueObjectOptions & SetUseTypeDisplayName(bool dis=false)
Definition: DumpValueObjectOptions.cpp:174
lldb_private::DumpValueObjectOptions::SetHideName
DumpValueObjectOptions & SetHideName(bool hide_name=false)
Definition: DumpValueObjectOptions.cpp:146
lldb_private::DumpValueObjectOptions::SetUseObjectiveC
DumpValueObjectOptions & SetUseObjectiveC(bool use=false)
Definition: DumpValueObjectOptions.cpp:63
lldb_private::DumpValueObjectOptions::SetFlatOutput
DumpValueObjectOptions & SetFlatOutput(bool flat=false)
Definition: DumpValueObjectOptions.cpp:93
lldb_private::DumpValueObjectOptions::m_max_depth_is_default
bool m_max_depth_is_default
Definition: DumpValueObjectOptions.h:128
lldb_private::DumpValueObjectOptions::SetIgnoreCap
DumpValueObjectOptions & SetIgnoreCap(bool ignore=false)
Definition: DumpValueObjectOptions.cpp:104
lldb_private::DumpValueObjectOptions::PointerAsArraySettings
Definition: DumpValueObjectOptions.h:37
lldb_private::DumpValueObjectOptions::m_show_types
bool m_show_types
Definition: DumpValueObjectOptions.h:142
lldb_private::DumpValueObjectOptions::m_run_validator
bool m_run_validator
Definition: DumpValueObjectOptions.h:148
lldb_private::DumpValueObjectOptions::SetRawDisplay
DumpValueObjectOptions & SetRawDisplay()
Definition: DumpValueObjectOptions.cpp:109
lldb_private::DumpValueObjectOptions::m_use_objc
bool m_use_objc
Definition: DumpValueObjectOptions.h:144
lldb_private::DumpValueObjectOptions::SetUseSyntheticValue
DumpValueObjectOptions & SetUseSyntheticValue(bool use_synthetic=true)
Definition: DumpValueObjectOptions.cpp:83
lldb_private::DumpValueObjectOptions::m_reveal_empty_aggregates
bool m_reveal_empty_aggregates
Definition: DumpValueObjectOptions.h:152
lldb_private::DumpValueObjectOptions::SetVariableFormatDisplayLanguage
DumpValueObjectOptions & SetVariableFormatDisplayLanguage(lldb::LanguageType lang=lldb::eLanguageTypeUnknown)
Definition: DumpValueObjectOptions.cpp:162
lldb_private::DumpValueObjectOptions::m_root_valobj_name
std::string m_root_valobj_name
Definition: DumpValueObjectOptions.h:133
lldb::DynamicValueType
DynamicValueType
Definition: lldb-enumerations.h:494
lldb_private::DumpValueObjectOptions::SetSummary
DumpValueObjectOptions & SetSummary(lldb::TypeSummaryImplSP summary=lldb::TypeSummaryImplSP())
Definition: DumpValueObjectOptions.cpp:126
ValueObject.h
lldb_private::DumpValueObjectOptions::m_hide_pointer_value
bool m_hide_pointer_value
Definition: DumpValueObjectOptions.h:151
lldb_private::DumpValueObjectOptions::m_allow_oneliner_mode
bool m_allow_oneliner_mode
Definition: DumpValueObjectOptions.h:150
lldb_private::DumpValueObjectOptions::SetHidePointerValue
DumpValueObjectOptions & SetHidePointerValue(bool hide=false)
Definition: DumpValueObjectOptions.cpp:156
lldb_private::ValueObject::GetPreferredDisplayLanguage
virtual lldb::LanguageType GetPreferredDisplayLanguage()
Definition: ValueObject.cpp:3079
lldb_private::DumpValueObjectOptions::PointerDepth::Mode::Default
@ Default
lldb_private::DumpValueObjectOptions::m_pointer_as_array
PointerAsArraySettings m_pointer_as_array
Definition: DumpValueObjectOptions.h:137
lldb_private::ValueObject
ValueObject:
Definition: ValueObject.h:105
uint32_t
lldb_private::DumpValueObjectOptions::m_use_dynamic
lldb::DynamicValueType m_use_dynamic
Definition: DumpValueObjectOptions.h:129
lldb_private::DumpValueObjectOptions::m_max_depth
uint32_t m_max_depth
Definition: DumpValueObjectOptions.h:127
DumpValueObjectOptions.h
UINT32_MAX
#define UINT32_MAX
Definition: lldb-defines.h:19
lldb_private::ValueObject::GetDynamicValueType
lldb::DynamicValueType GetDynamicValueType()
Definition: ValueObject.cpp:3059
lldb_private::DumpValueObjectOptions::SetShowLocation
DumpValueObjectOptions & SetShowLocation(bool show=false)
Definition: DumpValueObjectOptions.cpp:58
lldb_private::DumpValueObjectOptions::SetHideValue
DumpValueObjectOptions & SetHideValue(bool hide_value=false)
Definition: DumpValueObjectOptions.cpp:151
lldb_private::DumpValueObjectOptions::m_decl_printing_helper
DeclPrintingHelper m_decl_printing_helper
Definition: DumpValueObjectOptions.h:136
lldb_private::DumpValueObjectOptions
Definition: DumpValueObjectOptions.h:22
lldb_private::DumpValueObjectOptions::m_ignore_cap
bool m_ignore_cap
Definition: DumpValueObjectOptions.h:141
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::DumpValueObjectOptions::m_max_ptr_depth
PointerDepth m_max_ptr_depth
Definition: DumpValueObjectOptions.h:135
lldb_private::DumpValueObjectOptions::SetElementCount
DumpValueObjectOptions & SetElementCount(uint32_t element_count=0)
Definition: DumpValueObjectOptions.cpp:192
lldb_private::DumpValueObjectOptions::PointerDepth
Definition: DumpValueObjectOptions.h:24
lldb_private::DumpValueObjectOptions::SetScopeChecked
DumpValueObjectOptions & SetScopeChecked(bool check=true)
Definition: DumpValueObjectOptions.cpp:88
lldb_private::DumpValueObjectOptions::m_show_location
bool m_show_location
Definition: DumpValueObjectOptions.h:143
lldb_private::DumpValueObjectOptions::SetRunValidator
DumpValueObjectOptions & SetRunValidator(bool run=true)
Definition: DumpValueObjectOptions.cpp:168
lldb_private::DumpValueObjectOptions::SetMaximumDepth
DumpValueObjectOptions & SetMaximumDepth(uint32_t depth, bool is_default)
Definition: DumpValueObjectOptions.cpp:41
lldb_private::DumpValueObjectOptions::SetPointerAsArray
DumpValueObjectOptions & SetPointerAsArray(const PointerAsArraySettings &ptr_array)
Definition: DumpValueObjectOptions.cpp:197
lldb_private::DumpValueObjectOptions::SetShowSummary
DumpValueObjectOptions & SetShowSummary(bool show=true)
Definition: DumpValueObjectOptions.cpp:68
lldb_private::DumpValueObjectOptions::m_hide_value
bool m_hide_value
Definition: DumpValueObjectOptions.h:147
lldb
Definition: SBAddress.h:15
lldb_private::DumpValueObjectOptions::SetRootValueObjectName
DumpValueObjectOptions & SetRootValueObjectName(const char *name=nullptr)
Definition: DumpValueObjectOptions.cpp:132