LLDB mainline
|
#include <ValueObjectPrinter.h>
Public Member Functions | |
ValueObjectPrinter (ValueObject &valobj, Stream *s) | |
The ValueObjectPrinter is a one-shot printer for ValueObjects. | |
ValueObjectPrinter (ValueObject &valobj, Stream *s, const DumpValueObjectOptions &options) | |
~ValueObjectPrinter ()=default | |
bool | PrintValueObject () |
Protected Types | |
typedef std::set< uint64_t > | InstancePointersSet |
typedef std::shared_ptr< InstancePointersSet > | InstancePointersSetSP |
Protected Member Functions | |
ValueObjectPrinter (ValueObject &valobj, Stream *s, const DumpValueObjectOptions &options, const DumpValueObjectOptions::PointerDepth &ptr_depth, uint32_t curr_depth, InstancePointersSetSP printed_instance_pointers) | |
void | Init (ValueObject &valobj, Stream *s, const DumpValueObjectOptions &options, const DumpValueObjectOptions::PointerDepth &ptr_depth, uint32_t curr_depth, InstancePointersSetSP printed_instance_pointers) |
ValueObject & | GetMostSpecializedValue () |
Cache the ValueObject we are actually going to print. | |
void | SetupMostSpecializedValue () |
const char * | GetDescriptionForDisplay () |
const char * | GetRootNameForDisplay () |
bool | ShouldPrintValueObject () |
bool | IsNil () |
bool | IsUninitialized () |
bool | IsPtr () |
bool | IsRef () |
bool | IsInstancePointer () |
bool | IsAggregate () |
bool | PrintLocationIfNeeded () |
void | PrintDecl () |
bool | CheckScopeIfNeeded () |
bool | ShouldPrintEmptyBrackets (bool value_printed, bool summary_printed) |
TypeSummaryImpl * | GetSummaryFormatter (bool null_if_omitted=true) |
void | GetValueSummaryError (std::string &value, std::string &summary, std::string &error) |
bool | PrintValueAndSummaryIfNeeded (bool &value_printed, bool &summary_printed) |
bool | PrintObjectDescriptionIfNeeded (bool value_printed, bool summary_printed) |
bool | ShouldPrintChildren (DumpValueObjectOptions::PointerDepth &curr_ptr_depth) |
bool | ShouldExpandEmptyAggregates () |
ValueObject & | GetValueObjectForChildrenGeneration () |
void | PrintChildrenPreamble (bool value_printed, bool summary_printed) |
void | PrintChildrenPostamble (bool print_dotdotdot) |
lldb::ValueObjectSP | GenerateChild (ValueObject &synth_valobj, size_t idx) |
void | PrintChild (lldb::ValueObjectSP child_sp, const DumpValueObjectOptions::PointerDepth &curr_ptr_depth) |
llvm::Expected< uint32_t > | GetMaxNumChildrenToPrint (bool &print_dotdotdot) |
void | PrintChildren (bool value_printed, bool summary_printed, const DumpValueObjectOptions::PointerDepth &curr_ptr_depth) |
void | PrintChildrenIfNeeded (bool value_printed, bool summary_printed) |
bool | PrintChildrenOneLiner (bool hide_names) |
bool | HasReachedMaximumDepth () |
Protected Attributes | |
InstancePointersSetSP | m_printed_instance_pointers |
Private Member Functions | |
bool | ShouldShowName () const |
ValueObjectPrinter (const ValueObjectPrinter &)=delete | |
const ValueObjectPrinter & | operator= (const ValueObjectPrinter &)=delete |
Private Attributes | |
ValueObject & | m_orig_valobj |
ValueObject * | m_cached_valobj |
Stream * | m_stream |
Cache the current "most specialized" value. | |
DumpValueObjectOptions | m_options |
Flags | m_type_flags |
CompilerType | m_compiler_type |
DumpValueObjectOptions::PointerDepth | m_ptr_depth |
uint32_t | m_curr_depth |
LazyBool | m_should_print |
LazyBool | m_is_nil |
LazyBool | m_is_uninit |
LazyBool | m_is_ptr |
LazyBool | m_is_ref |
LazyBool | m_is_aggregate |
LazyBool | m_is_instance_ptr |
std::pair< TypeSummaryImpl *, bool > | m_summary_formatter |
std::string | m_value |
std::string | m_summary |
std::string | m_error |
bool | m_val_summary_ok |
Friends | |
struct | StringSummaryFormat |
Definition at line 23 of file ValueObjectPrinter.h.
|
protected |
Definition at line 40 of file ValueObjectPrinter.h.
|
protected |
Definition at line 41 of file ValueObjectPrinter.h.
ValueObjectPrinter::ValueObjectPrinter | ( | ValueObject & | valobj, |
Stream * | s | ||
) |
The ValueObjectPrinter is a one-shot printer for ValueObjects.
It does not retain the ValueObject it is printing, that is the job of its caller. It also doesn't attempt to track changes in the ValueObject, e.g. changing synthetic child providers or changing dynamic vrs. static vrs. synthetic settings.
Definition at line 21 of file ValueObjectPrinter.cpp.
References Init(), lldb_private::DumpValueObjectOptions::m_max_ptr_depth, and m_options.
ValueObjectPrinter::ValueObjectPrinter | ( | ValueObject & | valobj, |
Stream * | s, | ||
const DumpValueObjectOptions & | options | ||
) |
Definition at line 27 of file ValueObjectPrinter.cpp.
References Init(), lldb_private::DumpValueObjectOptions::m_max_ptr_depth, and m_options.
|
default |
|
protected |
Definition at line 33 of file ValueObjectPrinter.cpp.
References Init().
|
privatedelete |
|
protected |
Definition at line 325 of file ValueObjectPrinter.cpp.
References GetMostSpecializedValue(), lldb_private::ValueObject::IsInScope(), m_options, and lldb_private::DumpValueObjectOptions::m_scope_already_checked.
Referenced by PrintValueAndSummaryIfNeeded().
|
protected |
Definition at line 690 of file ValueObjectPrinter.cpp.
References lldb_private::ValueObject::GetChildAtIndex(), lldb_private::ValueObject::GetSyntheticArrayMember(), and PhysicalIndexForLogicalIndex().
|
protected |
Definition at line 148 of file ValueObjectPrinter.cpp.
References GetMostSpecializedValue(), lldb_private::ValueObject::GetObjectDescription(), lldb_private::ValueObject::GetSummaryAsCString(), and lldb_private::ValueObject::GetValueAsCString().
Referenced by PrintObjectDescriptionIfNeeded().
|
protected |
Definition at line 625 of file ValueObjectPrinter.cpp.
References lldb_private::ValueObject::GetNumChildren().
|
protected |
Cache the ValueObject we are actually going to print.
If this ValueObject has a Dynamic type, we return that, if either the original ValueObject or its Dynamic type has a Synthetic provider, return that. This will never return an empty ValueObject, since we use the ValueObject to carry errors. Note, this gets called when making the printer object, and uses the use dynamic and use synthetic settings of the ValueObject being printed, so changes made to these settings won't affect already made ValueObjectPrinters. SetupMostSpecializedValue(); Access the cached "most specialized value" - that is the one to use for printing the value object's value. However, be sure to use GetValueForChildGeneration when you are generating the children of this value.
Definition at line 101 of file ValueObjectPrinter.cpp.
References m_cached_valobj.
Referenced by CheckScopeIfNeeded(), GetDescriptionForDisplay(), GetRootNameForDisplay(), GetSummaryFormatter(), GetValueSummaryError(), IsInstancePointer(), IsNil(), IsUninitialized(), PrintDecl(), PrintLocationIfNeeded(), PrintObjectDescriptionIfNeeded(), and PrintValueAndSummaryIfNeeded().
|
protected |
Definition at line 158 of file ValueObjectPrinter.cpp.
References lldb_private::ConstString::AsCString(), GetMostSpecializedValue(), lldb_private::ValueObject::GetName(), m_options, and lldb_private::DumpValueObjectOptions::m_root_valobj_name.
Referenced by PrintDecl().
|
protected |
Definition at line 331 of file ValueObjectPrinter.cpp.
References GetMostSpecializedValue(), lldb_private::ValueObject::GetSummaryFormat(), lldb_private::DumpValueObjectOptions::m_omit_summary_depth, m_options, m_summary_formatter, and lldb_private::DumpValueObjectOptions::m_summary_sp.
Referenced by GetValueSummaryError(), and PrintValueAndSummaryIfNeeded().
|
protected |
Definition at line 570 of file ValueObjectPrinter.cpp.
|
protected |
Definition at line 355 of file ValueObjectPrinter.cpp.
References lldb_private::Status::AsCString(), lldb::eFormatDefault, lldb::eLanguageTypeUnknown, error(), lldb_private::Language::FindPlugin(), lldb_private::ValueObject::GetError(), lldb_private::ValueObject::GetFormat(), GetMostSpecializedValue(), lldb_private::ValueObject::GetPreferredDisplayLanguage(), lldb_private::ValueObject::GetSummaryAsCString(), GetSummaryFormatter(), lldb_private::ValueObject::GetValueAsCString(), IsNil(), IsUninitialized(), lldb_private::DumpValueObjectOptions::m_format, lldb_private::DumpValueObjectOptions::m_omit_summary_depth, m_options, lldb_private::DumpValueObjectOptions::m_pointer_as_array, lldb_private::DumpValueObjectOptions::m_varformat_language, and ShouldPrintValueObject().
Referenced by PrintValueAndSummaryIfNeeded().
|
protected |
Definition at line 858 of file ValueObjectPrinter.cpp.
|
protected |
Definition at line 41 of file ValueObjectPrinter.cpp.
References lldb_private::eLazyBoolCalculate, m_cached_valobj, m_curr_depth, m_error, m_is_aggregate, m_is_instance_ptr, m_is_nil, m_is_ptr, m_is_ref, m_is_uninit, m_options, m_printed_instance_pointers, m_ptr_depth, m_should_print, m_stream, m_summary, m_summary_formatter, m_val_summary_ok, m_value, and SetupMostSpecializedValue().
Referenced by ValueObjectPrinter().
|
protected |
Definition at line 202 of file ValueObjectPrinter.cpp.
References lldb_private::eLazyBoolCalculate, lldb_private::eLazyBoolNo, lldb_private::eLazyBoolYes, m_is_aggregate, m_type_flags, and lldb_private::Flags::Test().
|
protected |
Definition at line 209 of file ValueObjectPrinter.cpp.
References lldb_private::eLazyBoolCalculate, lldb_private::eLazyBoolNo, lldb_private::eLazyBoolYes, lldb_private::Value::GetCompilerType(), GetMostSpecializedValue(), lldb_private::CompilerType::GetTypeInfo(), lldb_private::ValueObject::GetValue(), lldb_private::ValueObject::IsBaseClass(), and m_is_instance_ptr.
|
protected |
Definition at line 175 of file ValueObjectPrinter.cpp.
References lldb_private::eLazyBoolCalculate, lldb_private::eLazyBoolNo, lldb_private::eLazyBoolYes, GetMostSpecializedValue(), lldb_private::ValueObject::IsNilReference(), and m_is_nil.
Referenced by GetValueSummaryError(), PrintObjectDescriptionIfNeeded(), and PrintValueAndSummaryIfNeeded().
|
protected |
Definition at line 190 of file ValueObjectPrinter.cpp.
References lldb_private::eLazyBoolCalculate, lldb_private::eLazyBoolNo, lldb_private::eLazyBoolYes, m_is_ptr, m_type_flags, and lldb_private::Flags::Test().
|
protected |
Definition at line 196 of file ValueObjectPrinter.cpp.
References lldb_private::eLazyBoolCalculate, lldb_private::eLazyBoolNo, lldb_private::eLazyBoolYes, m_is_ref, m_type_flags, and lldb_private::Flags::Test().
|
protected |
Definition at line 182 of file ValueObjectPrinter.cpp.
References lldb_private::eLazyBoolCalculate, lldb_private::eLazyBoolNo, lldb_private::eLazyBoolYes, GetMostSpecializedValue(), lldb_private::ValueObject::IsUninitializedReference(), and m_is_uninit.
Referenced by GetValueSummaryError(), PrintObjectDescriptionIfNeeded(), and PrintValueAndSummaryIfNeeded().
|
privatedelete |
|
protected |
Definition at line 592 of file ValueObjectPrinter.cpp.
References lldb_private::DumpValueObjectOptions::PointerDepth::Decremented(), lldb_private::DumpValueObjectOptions::m_omit_summary_depth, PrintValueObject(), lldb_private::DumpValueObjectOptions::SetElementCount(), lldb_private::DumpValueObjectOptions::SetFormat(), lldb_private::DumpValueObjectOptions::SetHideName(), lldb_private::DumpValueObjectOptions::SetHideValue(), lldb_private::DumpValueObjectOptions::SetOmitSummaryDepth(), lldb_private::DumpValueObjectOptions::SetRootValueObjectName(), lldb_private::DumpValueObjectOptions::SetScopeChecked(), and lldb_private::DumpValueObjectOptions::SetSummary().
|
protected |
Definition at line 705 of file ValueObjectPrinter.cpp.
|
protected |
Definition at line 810 of file ValueObjectPrinter.cpp.
References lldb_private::DumpValueObjectOptions::PointerDepth::CanAllowExpansion(), lldb_private::ValueObject::GetTargetSP(), lldb_private::ValueObject::GetValueAsUnsigned(), and lldb_private::DataVisualization::ShouldPrintAsOneLiner().
Referenced by PrintValueObject().
|
protected |
Definition at line 761 of file ValueObjectPrinter.cpp.
References lldb_private::ValueObject::eDisable, lldb_private::ValueObject::eValueObjectRepresentationStyleSummary, and lldb_private::ValueObject::GetChildAtIndex().
Referenced by lldb_private::StringSummaryFormat::FormatObject().
|
protected |
Definition at line 649 of file ValueObjectPrinter.cpp.
|
protected |
Definition at line 574 of file ValueObjectPrinter.cpp.
|
protected |
Definition at line 230 of file ValueObjectPrinter.cpp.
References lldb::eLanguageTypeUnknown, lldb_private::StreamString::Empty(), lldb_private::Language::FindPlugin(), lldb_private::ConstString::GetCString(), lldb_private::StreamString::GetData(), lldb_private::ValueObject::GetDisplayTypeName(), lldb_private::ValueObject::GetExpressionPath(), GetMostSpecializedValue(), lldb_private::ValueObject::GetPreferredDisplayLanguage(), lldb_private::ValueObject::GetQualifiedTypeName(), GetRootNameForDisplay(), lldb_private::StreamString::GetString(), lldb_private::CompilerType::IsValid(), m_compiler_type, m_curr_depth, lldb_private::DumpValueObjectOptions::m_decl_printing_helper, lldb_private::DumpValueObjectOptions::m_flat_output, lldb_private::DumpValueObjectOptions::m_hide_pointer_value, lldb_private::DumpValueObjectOptions::m_hide_root_type, m_options, lldb_private::DumpValueObjectOptions::m_show_types, m_stream, lldb_private::DumpValueObjectOptions::m_use_type_display_name, lldb_private::DumpValueObjectOptions::m_varformat_language, lldb_private::Stream::Printf(), lldb_private::Stream::PutCString(), lldb_private::DumpValueObjectOptions::SetHideName(), and ShouldShowName().
Referenced by PrintValueObject().
|
protected |
Definition at line 222 of file ValueObjectPrinter.cpp.
References GetMostSpecializedValue(), m_options, lldb_private::DumpValueObjectOptions::m_show_location, m_stream, and lldb_private::Stream::Printf().
Referenced by PrintValueObject().
|
protected |
Definition at line 464 of file ValueObjectPrinter.cpp.
References GetDescriptionForDisplay(), GetMostSpecializedValue(), lldb_private::ValueObject::GetObjectDescription(), IsNil(), IsUninitialized(), lldb_private::DumpValueObjectOptions::m_hide_value, m_options, lldb_private::DumpValueObjectOptions::m_pointer_as_array, m_stream, lldb_private::DumpValueObjectOptions::m_use_objc, lldb_private::Stream::Printf(), ShouldPrintValueObject(), and ShouldShowName().
|
protected |
Definition at line 406 of file ValueObjectPrinter.cpp.
References CheckScopeIfNeeded(), lldb_private::TypeSummaryImpl::DoesPrintValue(), lldb::eFormatDefault, lldb_private::ValueObject::GetCompilerType(), GetMostSpecializedValue(), GetSummaryFormatter(), GetValueSummaryError(), IsNil(), IsPointerValue(), IsUninitialized(), lldb_private::CompilerType::IsValid(), m_compiler_type, m_error, lldb_private::DumpValueObjectOptions::m_format, lldb_private::DumpValueObjectOptions::m_hide_pointer_value, lldb_private::DumpValueObjectOptions::m_hide_value, m_options, m_stream, m_summary, m_value, lldb_private::Stream::Printf(), lldb_private::Stream::PutChar(), lldb_private::Stream::PutCString(), ShouldPrintValueObject(), and ShouldShowName().
Referenced by PrintValueObject().
bool ValueObjectPrinter::PrintValueObject | ( | ) |
Definition at line 70 of file ValueObjectPrinter.cpp.
References lldb_private::Status::AsCString(), lldb_private::Stream::EOL(), lldb_private::Status::Fail(), lldb_private::ValueObject::GetCompilerType(), lldb_private::ValueObject::GetError(), lldb_private::Stream::Indent(), lldb_private::CompilerType::IsValid(), m_orig_valobj, m_stream, m_val_summary_ok, PrintChildrenIfNeeded(), PrintDecl(), lldb_private::Stream::Printf(), PrintLocationIfNeeded(), PrintValueAndSummaryIfNeeded(), and ShouldPrintValueObject().
Referenced by CommandObjectFrameDiagnose::DoExecute(), lldb_private::ValueObject::Dump(), and PrintChild().
|
protected |
Definition at line 106 of file ValueObjectPrinter.cpp.
References lldb::eNoDynamicValues, lldb_private::ValueObject::GetCompilerType(), lldb_private::ValueObject::GetDynamicValue(), lldb_private::ValueObject::GetNonSyntheticValue(), lldb_private::ValueObject::GetStaticValue(), lldb_private::ValueObject::GetSyntheticValue(), lldb_private::CompilerType::GetTypeInfo(), lldb_private::ValueObject::IsDynamic(), lldb_private::ValueObject::IsSynthetic(), m_cached_valobj, m_compiler_type, m_options, m_orig_valobj, m_type_flags, lldb_private::DumpValueObjectOptions::m_use_dynamic, lldb_private::DumpValueObjectOptions::m_use_synthetic, and lldb_private::ValueObject::UpdateValueIfNeeded().
Referenced by Init().
|
protected |
Definition at line 561 of file ValueObjectPrinter.cpp.
References lldb_private::TypeSummaryImpl::DoesPrintEmptyAggregates().
|
protected |
Definition at line 505 of file ValueObjectPrinter.cpp.
References lldb_private::DumpValueObjectOptions::PointerDepth::CanAllowExpansion(), and lldb_private::ValueObject::GetPointerValue().
|
protected |
Definition at line 664 of file ValueObjectPrinter.cpp.
References lldb_private::ValueObject::MightHaveChildren().
|
protected |
Definition at line 166 of file ValueObjectPrinter.cpp.
References lldb_private::eLazyBoolCalculate, lldb_private::eLazyBoolNo, lldb_private::eLazyBoolYes, lldb_private::DumpValueObjectOptions::m_flat_output, m_options, m_should_print, m_type_flags, and lldb_private::Flags::Test().
Referenced by GetValueSummaryError(), PrintObjectDescriptionIfNeeded(), PrintValueAndSummaryIfNeeded(), and PrintValueObject().
|
private |
Definition at line 862 of file ValueObjectPrinter.cpp.
Referenced by PrintDecl(), PrintObjectDescriptionIfNeeded(), and PrintValueAndSummaryIfNeeded().
|
friend |
Definition at line 168 of file ValueObjectPrinter.h.
|
private |
Definition at line 146 of file ValueObjectPrinter.h.
Referenced by GetMostSpecializedValue(), Init(), and SetupMostSpecializedValue().
|
private |
Definition at line 152 of file ValueObjectPrinter.h.
Referenced by PrintDecl(), PrintValueAndSummaryIfNeeded(), and SetupMostSpecializedValue().
|
private |
Definition at line 154 of file ValueObjectPrinter.h.
Referenced by Init(), and PrintDecl().
|
private |
Definition at line 165 of file ValueObjectPrinter.h.
Referenced by Init(), and PrintValueAndSummaryIfNeeded().
|
private |
Definition at line 160 of file ValueObjectPrinter.h.
Referenced by Init(), and IsAggregate().
|
private |
Definition at line 161 of file ValueObjectPrinter.h.
Referenced by Init(), and IsInstancePointer().
|
private |
Definition at line 156 of file ValueObjectPrinter.h.
|
private |
Definition at line 158 of file ValueObjectPrinter.h.
|
private |
Definition at line 159 of file ValueObjectPrinter.h.
|
private |
Definition at line 157 of file ValueObjectPrinter.h.
Referenced by Init(), and IsUninitialized().
|
private |
Definition at line 150 of file ValueObjectPrinter.h.
Referenced by CheckScopeIfNeeded(), GetRootNameForDisplay(), GetSummaryFormatter(), GetValueSummaryError(), Init(), PrintDecl(), PrintLocationIfNeeded(), PrintObjectDescriptionIfNeeded(), PrintValueAndSummaryIfNeeded(), SetupMostSpecializedValue(), ShouldPrintValueObject(), and ValueObjectPrinter().
|
private |
Definition at line 145 of file ValueObjectPrinter.h.
Referenced by PrintValueObject(), and SetupMostSpecializedValue().
|
protected |
Definition at line 43 of file ValueObjectPrinter.h.
Referenced by Init().
|
private |
Definition at line 153 of file ValueObjectPrinter.h.
Referenced by Init().
|
private |
Definition at line 155 of file ValueObjectPrinter.h.
Referenced by Init(), and ShouldPrintValueObject().
|
private |
Cache the current "most specialized" value.
Don't use this directly, use GetMostSpecializedValue.
Definition at line 149 of file ValueObjectPrinter.h.
Referenced by Init(), PrintDecl(), PrintLocationIfNeeded(), PrintObjectDescriptionIfNeeded(), PrintValueAndSummaryIfNeeded(), and PrintValueObject().
|
private |
Definition at line 164 of file ValueObjectPrinter.h.
Referenced by Init(), and PrintValueAndSummaryIfNeeded().
|
private |
Definition at line 162 of file ValueObjectPrinter.h.
Referenced by GetSummaryFormatter(), and Init().
|
private |
Definition at line 151 of file ValueObjectPrinter.h.
Referenced by IsAggregate(), IsPtr(), IsRef(), SetupMostSpecializedValue(), and ShouldPrintValueObject().
|
private |
Definition at line 166 of file ValueObjectPrinter.h.
Referenced by Init(), and PrintValueObject().
|
private |
Definition at line 163 of file ValueObjectPrinter.h.
Referenced by Init(), and PrintValueAndSummaryIfNeeded().