17 #include "llvm/ADT/ArrayRef.h"
25 eArgTypeNone,
"Show the object as its full dynamic type, not its static "
26 "type, if available."},
29 "Show the object obeying its synthetic provider, if available."},
30 {
LLDB_OPT_SET_1,
false,
"depth",
'D', OptionParser::eRequiredArgument,
31 nullptr, {}, 0,
eArgTypeCount,
"Set the max recurse depth when dumping "
32 "aggregate types (default is infinity)."},
33 {
LLDB_OPT_SET_1,
false,
"flat",
'F', OptionParser::eNoArgument,
nullptr,
34 {}, 0,
eArgTypeNone,
"Display results in a flat format that uses "
35 "expression paths for each variable or member."},
36 {
LLDB_OPT_SET_1,
false,
"location",
'L', OptionParser::eNoArgument,
nullptr,
37 {}, 0,
eArgTypeNone,
"Show variable location information."},
40 "Display using a language-specific description API, if possible."},
41 {
LLDB_OPT_SET_1,
false,
"ptr-depth",
'P', OptionParser::eRequiredArgument,
42 nullptr, {}, 0,
eArgTypeCount,
"The number of pointers to be traversed "
43 "when dumping values (default is zero)."},
44 {
LLDB_OPT_SET_1,
false,
"show-types",
'T', OptionParser::eNoArgument,
46 "Show variable types when dumping values."},
48 OptionParser::eOptionalArgument,
nullptr, {}, 0,
eArgTypeCount,
49 "Set the depth at which omitting summary information stops (default is "
51 {
LLDB_OPT_SET_1,
false,
"raw-output",
'R', OptionParser::eNoArgument,
52 nullptr, {}, 0,
eArgTypeNone,
"Don't use formatting options."},
53 {
LLDB_OPT_SET_1,
false,
"show-all-children",
'A', OptionParser::eNoArgument,
55 "Ignore the upper bound on the number of children to show."},
56 {
LLDB_OPT_SET_1,
false,
"validate",
'V', OptionParser::eRequiredArgument,
59 OptionParser::eRequiredArgument,
nullptr, {}, 0,
eArgTypeCount,
60 "Treat the result of the expression as if its type is an array of this "
63 llvm::ArrayRef<OptionDefinition>
64 OptionGroupValueObjectDisplay::GetDefinitions() {
68 Status OptionGroupValueObjectDisplay::SetOptionValue(
69 uint32_t option_idx, llvm::StringRef option_arg,
75 switch (short_option) {
103 if (option_arg.getAsInteger(0, max_depth)) {
105 error.SetErrorStringWithFormat(
"invalid max depth '%s'",
106 option_arg.str().c_str());
108 max_depth_is_default =
false;
113 if (option_arg.getAsInteger(0, elem_count)) {
115 error.SetErrorStringWithFormat(
"invalid element count '%s'",
116 option_arg.str().c_str());
121 if (option_arg.getAsInteger(0, ptr_depth)) {
123 error.SetErrorStringWithFormat(
"invalid pointer depth '%s'",
124 option_arg.str().c_str());
129 if (option_arg.empty())
130 no_summary_depth = 1;
131 else if (option_arg.getAsInteger(0, no_summary_depth)) {
132 no_summary_depth = 0;
133 error.SetErrorStringWithFormat(
"invalid pointer depth '%s'",
134 option_arg.str().c_str());
139 use_synth = OptionArgParser::ToBoolean(option_arg,
true, &success);
141 error.SetErrorStringWithFormat(
"invalid synthetic-type '%s'",
142 option_arg.str().c_str());
146 run_validator = OptionArgParser::ToBoolean(option_arg,
true, &success);
148 error.SetErrorStringWithFormat(
"invalid validate '%s'",
149 option_arg.str().c_str());
153 llvm_unreachable(
"Unimplemented option");
159 void OptionGroupValueObjectDisplay::OptionParsingStarting(
163 no_summary_depth = 0;
164 show_location =
false;
168 max_depth_is_default =
true;
174 run_validator =
false;
177 execution_context ? execution_context->
GetTargetSP() : TargetSP();
179 use_dynamic = target_sp->GetPreferDynamicValue();
180 auto max_depth_config = target_sp->GetMaximumDepthOfChildrenToDisplay();
181 max_depth = std::get<uint32_t>(max_depth_config);
182 max_depth_is_default = std::get<bool>(max_depth_config);
191 lldb::Format format, lldb::TypeSummaryImplSP summary_sp) {
194 {DumpValueObjectOptions::PointerDepth::Mode::Always, ptr_depth});
210 if (lang_descr_verbosity ==