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 | |
llvm::Error | 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) | |
Only this class (and subclasses, if any) should ever be concerned with the depth mechanism. | |
void | Init (ValueObject &valobj, Stream *s, const DumpValueObjectOptions &options, const DumpValueObjectOptions::PointerDepth &ptr_depth, uint32_t curr_depth, InstancePointersSetSP printed_instance_pointers) |
Ee should actually be using delegating constructors here but some versions of GCC still have trouble with those. | |
ValueObject & | GetMostSpecializedValue () |
Cache the ValueObject we are actually going to print. | |
void | SetupMostSpecializedValue () |
llvm::Expected< std::string > | 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) |
llvm::Error | 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) |
llvm::Error | 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 |
Cache the current "most specialized" value. | |
Stream * | m_stream |
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 22 of file ValueObjectPrinter.h.
|
protected |
Definition at line 39 of file ValueObjectPrinter.h.
|
protected |
Definition at line 40 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 versus static versus synthetic settings.
Definition at line 23 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 29 of file ValueObjectPrinter.cpp.
References Init(), lldb_private::DumpValueObjectOptions::m_max_ptr_depth, and m_options.
|
default |
|
protected |
Only this class (and subclasses, if any) should ever be concerned with the depth mechanism.
Definition at line 35 of file ValueObjectPrinter.cpp.
References Init().
|
privatedelete |
|
protected |
Definition at line 332 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 699 of file ValueObjectPrinter.cpp.
References lldb_private::ValueObject::GetChildAtIndex(), lldb_private::ValueObject::GetSyntheticArrayMember(), and PhysicalIndexForLogicalIndex().
|
protected |
Definition at line 147 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 635 of file ValueObjectPrinter.cpp.
References lldb_private::ValueObject::GetNumChildren(), and UINT32_MAX.
|
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 100 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 165 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 338 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 574 of file ValueObjectPrinter.cpp.
|
protected |
Definition at line 362 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 871 of file ValueObjectPrinter.cpp.
|
protected |
Ee should actually be using delegating constructors here but some versions of GCC still have trouble with those.
Definition at line 43 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 209 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 216 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 182 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 197 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 203 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 189 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 596 of file ValueObjectPrinter.cpp.
References lldb_private::DumpValueObjectOptions::PointerDepth::Decremented(), error(), 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(), lldb_private::DumpValueObjectOptions::SetSummary(), and lldb_private::toString().
|
protected |
Definition at line 714 of file ValueObjectPrinter.cpp.
|
protected |
Definition at line 819 of file ValueObjectPrinter.cpp.
References lldb_private::DumpValueObjectOptions::PointerDepth::CanAllowExpansion(), error(), lldb_private::ValueObject::GetTargetSP(), lldb_private::ValueObject::GetValueAsUnsigned(), and lldb_private::DataVisualization::ShouldPrintAsOneLiner().
Referenced by PrintValueObject().
|
protected |
Definition at line 770 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 658 of file ValueObjectPrinter.cpp.
|
protected |
Definition at line 578 of file ValueObjectPrinter.cpp.
|
protected |
Definition at line 237 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 229 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 472 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, ShouldPrintValueObject(), and ShouldShowName().
|
protected |
Definition at line 413 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().
llvm::Error ValueObjectPrinter::PrintValueObject | ( | ) |
Definition at line 72 of file ValueObjectPrinter.cpp.
References 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(), PrintLocationIfNeeded(), PrintValueAndSummaryIfNeeded(), ShouldPrintValueObject(), and lldb_private::Status::ToError().
Referenced by CommandObjectFrameDiagnose::DoExecute(), lldb_private::ValueObject::Dump(), and PrintChild().
|
protected |
Definition at line 105 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 565 of file ValueObjectPrinter.cpp.
References lldb_private::TypeSummaryImpl::DoesPrintEmptyAggregates().
|
protected |
Definition at line 509 of file ValueObjectPrinter.cpp.
References lldb_private::DumpValueObjectOptions::PointerDepth::CanAllowExpansion(), and lldb_private::ValueObject::GetPointerValue().
|
protected |
Definition at line 673 of file ValueObjectPrinter.cpp.
References lldb_private::ValueObject::MightHaveChildren().
|
protected |
Definition at line 173 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 875 of file ValueObjectPrinter.cpp.
Referenced by PrintDecl(), PrintObjectDescriptionIfNeeded(), and PrintValueAndSummaryIfNeeded().
|
friend |
Definition at line 168 of file ValueObjectPrinter.h.
|
private |
Cache the current "most specialized" value.
Don't use this directly, use GetMostSpecializedValue.
Definition at line 148 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 42 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 |
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().