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 () |
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) |
void | PrintObjectDescriptionIfNeeded (std::optional< std::string > object_desc) |
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 |
bool | ShouldPrintObjectDescription () |
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 26 of file ValueObjectPrinter.cpp.
References Init(), m_options, and m_orig_valobj.
Referenced by operator=(), PrintChild(), and ValueObjectPrinter().
ValueObjectPrinter::ValueObjectPrinter | ( | ValueObject & | valobj, |
Stream * | s, | ||
const DumpValueObjectOptions & | options ) |
Definition at line 32 of file ValueObjectPrinter.cpp.
References Init(), m_options, and m_orig_valobj.
|
default |
|
protected |
Only this class (and subclasses, if any) should ever be concerned with the depth mechanism.
Definition at line 38 of file ValueObjectPrinter.cpp.
References Init(), and m_orig_valobj.
|
privatedelete |
References ValueObjectPrinter().
|
protected |
Definition at line 349 of file ValueObjectPrinter.cpp.
References GetMostSpecializedValue(), lldb_private::ValueObject::IsInScope(), and m_options.
Referenced by PrintValueAndSummaryIfNeeded().
|
protected |
Definition at line 693 of file ValueObjectPrinter.cpp.
References lldb_private::ValueObject::GetChildAtIndex(), lldb_private::ValueObject::GetSyntheticArrayMember(), m_options, and PhysicalIndexForLogicalIndex().
Referenced by PrintChildren().
|
protected |
Definition at line 629 of file ValueObjectPrinter.cpp.
References GetMostSpecializedValue(), lldb_private::ValueObject::GetNumChildren(), GetValueObjectForChildrenGeneration(), m_options, and UINT32_MAX.
Referenced by PrintChildren(), and PrintChildrenOneLiner().
|
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 135 of file ValueObjectPrinter.cpp.
References m_cached_valobj.
Referenced by CheckScopeIfNeeded(), GetMaxNumChildrenToPrint(), GetRootNameForDisplay(), GetSummaryFormatter(), GetValueObjectForChildrenGeneration(), GetValueSummaryError(), IsInstancePointer(), IsNil(), IsUninitialized(), PrintChildren(), PrintChildrenIfNeeded(), PrintChildrenPostamble(), PrintDecl(), PrintLocationIfNeeded(), PrintValueAndSummaryIfNeeded(), PrintValueObject(), and ShouldPrintChildren().
|
protected |
Definition at line 182 of file ValueObjectPrinter.cpp.
References lldb_private::ConstString::AsCString(), GetMostSpecializedValue(), lldb_private::ValueObject::GetName(), and m_options.
Referenced by PrintDecl().
|
protected |
Definition at line 355 of file ValueObjectPrinter.cpp.
References GetMostSpecializedValue(), lldb_private::ValueObject::GetSummaryFormat(), m_options, and m_summary_formatter.
Referenced by GetValueSummaryError(), PrintValueAndSummaryIfNeeded(), ShouldExpandEmptyAggregates(), and ShouldPrintChildren().
|
protected |
Definition at line 568 of file ValueObjectPrinter.cpp.
References GetMostSpecializedValue().
Referenced by GetMaxNumChildrenToPrint(), PrintChildren(), PrintChildrenOneLiner(), and ShouldPrintEmptyBrackets().
|
protected |
Definition at line 379 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(), m_options, and ShouldPrintValueObject().
Referenced by PrintValueAndSummaryIfNeeded().
|
protected |
Definition at line 862 of file ValueObjectPrinter.cpp.
References m_curr_depth, and m_options.
Referenced by PrintChildrenIfNeeded(), and ShouldPrintChildren().
|
protected |
Ee should actually be using delegating constructors here but some versions of GCC still have trouble with those.
Definition at line 46 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(), ValueObjectPrinter(), and ValueObjectPrinter().
|
protected |
Definition at line 226 of file ValueObjectPrinter.cpp.
References lldb_private::eLazyBoolCalculate, lldb_private::eLazyBoolNo, lldb_private::eLazyBoolYes, m_is_aggregate, and m_type_flags.
Referenced by PrintChildrenIfNeeded(), and ShouldPrintEmptyBrackets().
|
protected |
Definition at line 233 of file ValueObjectPrinter.cpp.
References lldb_private::eLazyBoolCalculate, lldb_private::eLazyBoolNo, lldb_private::eLazyBoolYes, GetMostSpecializedValue(), lldb_private::ValueObject::GetValue(), lldb_private::ValueObject::IsBaseClass(), and m_is_instance_ptr.
Referenced by PrintChildrenIfNeeded().
|
protected |
Definition at line 199 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(), PrintValueAndSummaryIfNeeded(), and ShouldPrintObjectDescription().
|
protected |
Definition at line 214 of file ValueObjectPrinter.cpp.
References lldb_private::eLazyBoolCalculate, lldb_private::eLazyBoolNo, lldb_private::eLazyBoolYes, m_is_ptr, and m_type_flags.
Referenced by PrintChild(), and ShouldPrintChildren().
|
protected |
Definition at line 220 of file ValueObjectPrinter.cpp.
References lldb_private::eLazyBoolCalculate, lldb_private::eLazyBoolNo, lldb_private::eLazyBoolYes, m_is_ref, and m_type_flags.
Referenced by PrintChild(), PrintChildrenPreamble(), and ShouldPrintChildren().
|
protected |
Definition at line 206 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(), PrintValueAndSummaryIfNeeded(), ShouldPrintChildren(), and ShouldPrintObjectDescription().
|
privatedelete |
References ValueObjectPrinter().
|
protected |
Definition at line 590 of file ValueObjectPrinter.cpp.
References lldb_private::DumpValueObjectOptions::PointerDepth::Decremented(), error(), IsPtr(), IsRef(), m_curr_depth, lldb_private::DumpValueObjectOptions::m_omit_summary_depth, m_options, m_printed_instance_pointers, m_stream, 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(), lldb_private::toString(), and ValueObjectPrinter().
Referenced by PrintChildren().
|
protected |
Definition at line 708 of file ValueObjectPrinter.cpp.
References GenerateChild(), GetMaxNumChildrenToPrint(), GetMostSpecializedValue(), GetValueObjectForChildrenGeneration(), m_options, m_stream, PrintChild(), PrintChildrenPostamble(), PrintChildrenPreamble(), ShouldExpandEmptyAggregates(), ShouldPrintEmptyBrackets(), and ShouldPrintValueObject().
Referenced by PrintChildrenIfNeeded().
|
protected |
Definition at line 813 of file ValueObjectPrinter.cpp.
References lldb_private::DumpValueObjectOptions::PointerDepth::CanAllowExpansion(), GetMostSpecializedValue(), lldb_private::ValueObject::GetTargetSP(), lldb_private::ValueObject::GetValueAsUnsigned(), HasReachedMaximumDepth(), IsAggregate(), IsInstancePointer(), m_options, m_printed_instance_pointers, m_ptr_depth, m_stream, PrintChildren(), PrintChildrenOneLiner(), lldb_private::DataVisualization::ShouldPrintAsOneLiner(), ShouldPrintChildren(), and ShouldPrintValueObject().
Referenced by PrintValueObject().
Definition at line 764 of file ValueObjectPrinter.cpp.
References lldb_private::ValueObject::eDisable, lldb_private::ValueObject::eValueObjectRepresentationStyleSummary, lldb_private::ValueObject::GetChildAtIndex(), GetMaxNumChildrenToPrint(), GetValueObjectForChildrenGeneration(), m_options, and m_stream.
Referenced by lldb_private::StringSummaryFormat::FormatObject(), and PrintChildrenIfNeeded().
|
protected |
Definition at line 652 of file ValueObjectPrinter.cpp.
References GetMostSpecializedValue(), m_options, and m_stream.
Referenced by PrintChildren().
|
protected |
Definition at line 572 of file ValueObjectPrinter.cpp.
References IsRef(), m_options, m_stream, ShouldPrintValueObject(), and ShouldShowName().
Referenced by PrintChildren().
|
protected |
Definition at line 254 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(), m_compiler_type, m_curr_depth, m_options, m_stream, lldb_private::DumpValueObjectOptions::SetHideName(), and ShouldShowName().
Referenced by PrintValueObject().
|
protected |
Definition at line 246 of file ValueObjectPrinter.cpp.
References GetMostSpecializedValue(), m_options, and m_stream.
Referenced by PrintValueObject().
|
protected |
Definition at line 488 of file ValueObjectPrinter.cpp.
References m_options, m_stream, maybeNewline(), and ShouldShowName().
Referenced by PrintValueObject().
|
protected |
Definition at line 430 of file ValueObjectPrinter.cpp.
References CheckScopeIfNeeded(), lldb_private::TypeSummaryImpl::DoesPrintValue(), lldb::eFormatDefault, lldb_private::ValueObject::GetCompilerType(), GetMostSpecializedValue(), GetSummaryFormatter(), GetValueSummaryError(), IsNil(), IsPointerValue(), IsUninitialized(), m_compiler_type, m_error, m_options, m_stream, m_summary, m_value, ShouldPrintValueObject(), and ShouldShowName().
Referenced by PrintValueObject().
llvm::Error ValueObjectPrinter::PrintValueObject | ( | ) |
Definition at line 86 of file ValueObjectPrinter.cpp.
References GetMostSpecializedValue(), lldb_private::ValueObject::GetObjectDescription(), m_options, m_orig_valobj, m_stream, m_val_summary_ok, maybeNewline(), PrintChildrenIfNeeded(), PrintDecl(), PrintLocationIfNeeded(), PrintObjectDescriptionIfNeeded(), PrintValueAndSummaryIfNeeded(), ShouldPrintObjectDescription(), ShouldPrintValueObject(), and lldb_private::toString().
Referenced by CommandObjectFrameDiagnose::DoExecute(), lldb_private::ValueObject::Dump(), and PrintChild().
|
protected |
Definition at line 140 of file ValueObjectPrinter.cpp.
References lldb::eNoDynamicValues, m_cached_valobj, m_compiler_type, m_options, m_orig_valobj, and m_type_flags.
Referenced by Init().
|
protected |
Definition at line 559 of file ValueObjectPrinter.cpp.
References lldb_private::TypeSummaryImpl::DoesPrintEmptyAggregates(), and GetSummaryFormatter().
Referenced by PrintChildren().
|
protected |
Definition at line 502 of file ValueObjectPrinter.cpp.
References lldb_private::ValueObject::AddrAndType::address, lldb_private::DumpValueObjectOptions::PointerDepth::CanAllowExpansion(), GetMostSpecializedValue(), lldb_private::ValueObject::GetPointerValue(), GetSummaryFormatter(), HasReachedMaximumDepth(), IsPtr(), IsRef(), IsUninitialized(), m_curr_depth, m_options, m_summary, and m_type_flags.
Referenced by PrintChildrenIfNeeded().
|
protected |
Definition at line 667 of file ValueObjectPrinter.cpp.
References GetValueObjectForChildrenGeneration(), IsAggregate(), m_options, m_val_summary_ok, and lldb_private::ValueObject::MightHaveChildren().
Referenced by PrintChildren().
|
private |
Definition at line 81 of file ValueObjectPrinter.cpp.
References IsNil(), IsUninitialized(), m_options, and ShouldPrintValueObject().
Referenced by PrintValueObject().
|
protected |
Definition at line 190 of file ValueObjectPrinter.cpp.
References lldb_private::eLazyBoolCalculate, lldb_private::eLazyBoolNo, lldb_private::eLazyBoolYes, m_options, m_should_print, and m_type_flags.
Referenced by GetValueSummaryError(), PrintChildren(), PrintChildrenIfNeeded(), PrintChildrenPreamble(), PrintValueAndSummaryIfNeeded(), PrintValueObject(), and ShouldPrintObjectDescription().
|
private |
Definition at line 866 of file ValueObjectPrinter.cpp.
References m_curr_depth, and m_options.
Referenced by PrintChildrenPreamble(), PrintDecl(), PrintObjectDescriptionIfNeeded(), and PrintValueAndSummaryIfNeeded().
|
friend |
Definition at line 166 of file ValueObjectPrinter.h.
References StringSummaryFormat.
Referenced by StringSummaryFormat.
|
private |
Cache the current "most specialized" value.
Don't use this directly, use GetMostSpecializedValue.
Definition at line 146 of file ValueObjectPrinter.h.
Referenced by GetMostSpecializedValue(), Init(), and SetupMostSpecializedValue().
|
private |
Definition at line 150 of file ValueObjectPrinter.h.
Referenced by PrintDecl(), PrintValueAndSummaryIfNeeded(), and SetupMostSpecializedValue().
|
private |
Definition at line 152 of file ValueObjectPrinter.h.
Referenced by HasReachedMaximumDepth(), Init(), PrintChild(), PrintDecl(), ShouldPrintChildren(), and ShouldShowName().
|
private |
Definition at line 163 of file ValueObjectPrinter.h.
Referenced by Init(), and PrintValueAndSummaryIfNeeded().
|
private |
Definition at line 158 of file ValueObjectPrinter.h.
Referenced by Init(), and IsAggregate().
|
private |
Definition at line 159 of file ValueObjectPrinter.h.
Referenced by Init(), and IsInstancePointer().
|
private |
Definition at line 154 of file ValueObjectPrinter.h.
|
private |
Definition at line 156 of file ValueObjectPrinter.h.
|
private |
Definition at line 157 of file ValueObjectPrinter.h.
|
private |
Definition at line 155 of file ValueObjectPrinter.h.
Referenced by Init(), and IsUninitialized().
|
private |
Definition at line 148 of file ValueObjectPrinter.h.
Referenced by CheckScopeIfNeeded(), GenerateChild(), GetMaxNumChildrenToPrint(), GetRootNameForDisplay(), GetSummaryFormatter(), GetValueSummaryError(), HasReachedMaximumDepth(), Init(), PrintChild(), PrintChildren(), PrintChildrenIfNeeded(), PrintChildrenOneLiner(), PrintChildrenPostamble(), PrintChildrenPreamble(), PrintDecl(), PrintLocationIfNeeded(), PrintObjectDescriptionIfNeeded(), PrintValueAndSummaryIfNeeded(), PrintValueObject(), SetupMostSpecializedValue(), ShouldPrintChildren(), ShouldPrintEmptyBrackets(), ShouldPrintObjectDescription(), ShouldPrintValueObject(), ShouldShowName(), ValueObjectPrinter(), and ValueObjectPrinter().
|
private |
Definition at line 143 of file ValueObjectPrinter.h.
Referenced by PrintValueObject(), SetupMostSpecializedValue(), ValueObjectPrinter(), ValueObjectPrinter(), and ValueObjectPrinter().
|
protected |
Definition at line 42 of file ValueObjectPrinter.h.
Referenced by Init(), PrintChild(), and PrintChildrenIfNeeded().
|
private |
Definition at line 151 of file ValueObjectPrinter.h.
Referenced by Init(), and PrintChildrenIfNeeded().
|
private |
Definition at line 153 of file ValueObjectPrinter.h.
Referenced by Init(), and ShouldPrintValueObject().
|
private |
Definition at line 147 of file ValueObjectPrinter.h.
Referenced by Init(), PrintChild(), PrintChildren(), PrintChildrenIfNeeded(), PrintChildrenOneLiner(), PrintChildrenPostamble(), PrintChildrenPreamble(), PrintDecl(), PrintLocationIfNeeded(), PrintObjectDescriptionIfNeeded(), PrintValueAndSummaryIfNeeded(), and PrintValueObject().
|
private |
Definition at line 162 of file ValueObjectPrinter.h.
Referenced by Init(), PrintValueAndSummaryIfNeeded(), and ShouldPrintChildren().
|
private |
Definition at line 160 of file ValueObjectPrinter.h.
Referenced by GetSummaryFormatter(), and Init().
|
private |
Definition at line 149 of file ValueObjectPrinter.h.
Referenced by IsAggregate(), IsPtr(), IsRef(), SetupMostSpecializedValue(), ShouldPrintChildren(), and ShouldPrintValueObject().
|
private |
Definition at line 164 of file ValueObjectPrinter.h.
Referenced by Init(), PrintValueObject(), and ShouldPrintEmptyBrackets().
|
private |
Definition at line 161 of file ValueObjectPrinter.h.
Referenced by Init(), and PrintValueAndSummaryIfNeeded().