Refactoring of ValueObject::DumpValueObject and 'frame variable', 'target variable' commands to use an Options object instead of passing an ever-increasing number of arguments to the DumpValueObject() method, with the ultimate aim of making that call private implementation
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@137622 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Commands/CommandObjectTarget.cpp b/source/Commands/CommandObjectTarget.cpp
index 6bf136b..cebe9af 100644
--- a/source/Commands/CommandObjectTarget.cpp
+++ b/source/Commands/CommandObjectTarget.cpp
@@ -553,6 +553,19 @@
void
DumpValueObject (Stream &s, VariableSP &var_sp, ValueObjectSP &valobj_sp, const char *root_name)
{
+ ValueObject::DumpValueObjectOptions options;
+
+ options.SetPointerDepth(m_varobj_options.ptr_depth)
+ .SetMaximumDepth(m_varobj_options.max_depth)
+ .SetShowTypes(m_varobj_options.show_types)
+ .SetShowLocation(m_varobj_options.show_location)
+ .SetUseObjectiveC(m_varobj_options.use_objc)
+ .SetUseDynamicType(m_varobj_options.use_dynamic)
+ .SetUseSyntheticValue((lldb::SyntheticValueType)m_varobj_options.use_synth)
+ .SetFlatOutput(m_varobj_options.flat_output)
+ .SetOmitSummaryDepth(m_varobj_options.no_summary_depth)
+ .SetIgnoreCap(m_varobj_options.ignore_cap);
+
if (m_option_variable.format != eFormatDefault)
valobj_sp->SetFormat (m_option_variable.format);
@@ -597,18 +610,7 @@
ValueObject::DumpValueObject (s,
valobj_sp.get(),
root_name,
- m_varobj_options.ptr_depth,
- 0,
- m_varobj_options.max_depth,
- m_varobj_options.show_types,
- m_varobj_options.show_location,
- m_varobj_options.use_objc,
- m_varobj_options.use_dynamic,
- m_varobj_options.be_raw ? false : m_varobj_options.use_synth,
- false,
- m_varobj_options.flat_output,
- m_varobj_options.be_raw ? UINT32_MAX : m_varobj_options.no_summary_depth,
- m_varobj_options.be_raw ? true : m_varobj_options.ignore_cap);
+ options);
}