DumpValueObjectOptions::DumpValueObjectOptions (ValueObject& valobj) :
    DumpValueObjectOptions()
{
    m_use_dynamic = valobj.GetDynamicValueType();
    m_use_synthetic = valobj.IsSynthetic();
    m_varformat_language = valobj.GetPreferredDisplayLanguage();
}
Beispiel #2
0
static bool
SwiftOptional_SummaryProvider_Impl(ValueObject &valobj, Stream &stream,
                                   const TypeSummaryOptions &options) {
  PointerOrSP some =
      ExtractSomeIfAny(&valobj, valobj.GetDynamicValueType(), true);
  if (!some) {
    stream.Printf("nil");
    return true;
  }

  const char *value_summary = some->GetSummaryAsCString();

  if (value_summary)
    stream.Printf("%s", value_summary);
  else if (lldb_private::DataVisualization::ShouldPrintAsOneLiner(*some)) {
    TypeSummaryImpl::Flags oneliner_flags;
    oneliner_flags.SetHideItemNames(false)
        .SetCascades(true)
        .SetDontShowChildren(false)
        .SetDontShowValue(false)
        .SetShowMembersOneLiner(true)
        .SetSkipPointers(false)
        .SetSkipReferences(false);
    StringSummaryFormat oneliner(oneliner_flags, "");
    std::string buffer;
    oneliner.FormatObject(some, buffer, options);
    stream.Printf("%s", buffer.c_str());
  }

  return true;
}