LLDB mainline
lldb_private::FormatEntity::Formatter Class Reference

#include <FormatEntity.h>

Public Member Functions

 Formatter (const SymbolContext *sc, const ExecutionContext *exe_ctx, const Address *addr, bool function_changed, bool initial_function)
bool Format (const Entry &entry, Stream &s, ValueObject *valobj=nullptr)
bool FormatStringRef (const llvm::StringRef &format, Stream &s, ValueObject *valobj)

Private Member Functions

bool DumpValue (Stream &s, const FormatEntity::Entry &entry, ValueObject *valobj)
bool FormatFunctionNameForLanguage (Stream &s)
bool IsInvalidRecursiveFormat (Entry::Type type)
 Returns true if Format has been called for an Entry with the specified type recusrively.
auto PushEntryType (Entry::Type type)
 While the returned llvm::scope_exit is alive, the specified type is tracked by this Formatter object for recursion.

Private Attributes

const SymbolContext *const m_sc = nullptr
const ExecutionContext *const m_exe_ctx = nullptr
const Address *const m_addr = nullptr
const bool m_function_changed = false
const bool m_initial_function = false
llvm::SmallVector< Entry::Type, 1 > m_entry_type_stack

Detailed Description

Definition at line 233 of file FormatEntity.h.

Constructor & Destructor Documentation

◆ Formatter()

lldb_private::FormatEntity::Formatter::Formatter ( const SymbolContext * sc,
const ExecutionContext * exe_ctx,
const Address * addr,
bool function_changed,
bool initial_function )
inline

Definition at line 235 of file FormatEntity.h.

References m_addr, m_exe_ctx, m_function_changed, m_initial_function, and m_sc.

Member Function Documentation

◆ DumpValue()

bool FormatEntity::Formatter::DumpValue ( Stream & s,
const FormatEntity::Entry & entry,
ValueObject * valobj )
private

Definition at line 757 of file FormatEntity.cpp.

References lldb_private::ConstString::AsCString(), ConvertValueObjectStyleToChar(), lldb_private::DataFormatters, lldb_private::FormatEntity::Entry::deref, lldb_private::ValueObject::Dereference(), lldb_private::ValueObject::GetValueForExpressionPathOptions::DoAllowBitfieldSyntax(), lldb_private::ValueObject::GetValueForExpressionPathOptions::DoAllowFragileIVar(), lldb_private::ValueObject::GetValueForExpressionPathOptions::DontCheckDotVsArrowSyntax(), lldb_private::ValueObject::DumpPrintableRepresentation(), DumpValueWithLLVMFormat(), lldb_private::ValueObject::eDisable, lldb_private::ValueObject::eExpressionPathAftermathDereference, lldb_private::ValueObject::eExpressionPathAftermathNothing, lldb_private::ValueObject::eExpressionPathEndResultTypeBoundedRange, lldb_private::ValueObject::eExpressionPathEndResultTypePlain, lldb_private::ValueObject::eExpressionPathEndResultTypeUnboundedRange, lldb_private::ValueObject::eExpressionPathScanEndReasonEndOfString, lldb::eFormatDefault, lldb::eFormatInvalid, lldb::eFormatterMatchExact, error(), lldb_private::ValueObject::eValueObjectRepresentationStyleSummary, lldb_private::ValueObject::eValueObjectRepresentationStyleValue, ExpandIndexedExpression(), lldb_private::FormatEntity::Entry::fmt, Format(), FormatStringRef(), lldb_private::ValueObject::GetBitfieldBitSize(), lldb_private::ValueObject::GetCompilerType(), lldb_private::ConstString::GetCString(), lldb_private::ValueObject::GetDynamicValueType(), lldb_private::FormatManager::GetFormatAsCString(), lldb_private::FormatManager::GetFormatAsFormatChar(), lldb_private::ValueObject::GetLocationAsCString(), lldb_private::GetLog(), lldb_private::ValueObject::GetNumChildrenIgnoringErrors(), lldb_private::ValueObject::GetQualifiedRepresentationIfAvailable(), lldb_private::StreamString::GetString(), lldb_private::DataVisualization::GetSummaryForType(), lldb_private::ValueObject::GetSyntheticValue(), lldb_private::ValueObject::GetTargetSP(), lldb_private::CompilerType::GetTypeInfo(), lldb_private::ValueObject::GetTypeInfo(), lldb_private::ValueObject::GetTypeName(), lldb_private::ValueObject::GetValueForExpressionPath(), lldb_private::ValueObject::HasSpecialPrintableRepresentation(), lldb_private::CompilerType::IsAggregateType(), lldb_private::ValueObject::IsBitfield(), lldb_private::ValueObject::IsSynthetic(), LLDB_LOG, LLDB_LOGF, m_exe_ctx, m_sc, lldb_private::FormatEntity::Entry::number, lldb_private::Stream::Printf(), lldb_private::FormatEntity::Entry::printf_format, lldb_private::Stream::PutChar(), lldb_private::Stream::PutCString(), RunScriptFormatKeyword(), ScanBracketedRange(), lldb_private::FormatEntity::Entry::ScriptVariable, lldb_private::FormatEntity::Entry::ScriptVariableSynthetic, lldb_private::ValueObject::GetValueForExpressionPathOptions::SetSyntheticChildrenTraversal(), lldb_private::FormatEntity::Entry::string, lldb_private::FormatEntity::Entry::type, lldb_private::FormatEntity::Entry::Variable, and lldb_private::FormatEntity::Entry::VariableSynthetic.

Referenced by Format().

◆ Format()

bool FormatEntity::Formatter::Format ( const Entry & entry,
Stream & s,
ValueObject * valobj = nullptr )

Definition at line 1313 of file FormatEntity.cpp.

References lldb_private::FormatEntity::Entry::AddressFile, lldb_private::FormatEntity::Entry::AddressLoad, lldb_private::FormatEntity::Entry::AddressLoadOrFile, lldb_private::FormatEntity::Entry::children_stack, lldb_private::StreamString::Clear(), lldb_private::FormatEntity::Entry::CurrentPCArrow, lldb_private::DataFormatters, DumpAddressAndContent(), DumpAddressOffsetFromFunction(), DumpFile(), DumpRegister(), DumpValue(), lldb_private::Language::eName, lldb_private::Language::eNameWithNoArgs, lldb_private::Mangled::ePreferDemangled, lldb_private::Mangled::ePreferDemangledWithoutArguments, lldb_private::Mangled::ePreferMangled, lldb::eRegisterKindGeneric, error(), lldb_private::FormatEntity::Entry::EscapeCode, lldb::eStructuredDataTypeDictionary, lldb_private::FormatEntity::Entry::File, lldb_private::Language::FindPlugin(), lldb_private::Stream::Format(), FormatFunctionNameForLanguage(), FormatThreadExtendedInfoRecurse(), lldb_private::FormatEntity::Entry::FrameBorrowedInfo, lldb_private::FormatEntity::Entry::FrameIndex, lldb_private::FormatEntity::Entry::FrameIsArtificial, lldb_private::FormatEntity::Entry::FrameKind, lldb_private::FormatEntity::Entry::FrameNoDebug, lldb_private::FormatEntity::Entry::FrameRegisterByName, lldb_private::FormatEntity::Entry::FrameRegisterFlags, lldb_private::FormatEntity::Entry::FrameRegisterFP, lldb_private::FormatEntity::Entry::FrameRegisterPC, lldb_private::FormatEntity::Entry::FrameRegisterSP, lldb_private::FormatEntity::Entry::FunctionAddrOffset, lldb_private::FormatEntity::Entry::FunctionAddrOffsetConcrete, lldb_private::FormatEntity::Entry::FunctionBasename, lldb_private::FormatEntity::Entry::FunctionChanged, lldb_private::FormatEntity::Entry::FunctionDidChange, lldb_private::FormatEntity::Entry::FunctionFormattedArguments, lldb_private::FormatEntity::Entry::FunctionID, lldb_private::FormatEntity::Entry::FunctionInitial, lldb_private::FormatEntity::Entry::FunctionInitialFunction, lldb_private::FormatEntity::Entry::FunctionIsInlined, lldb_private::FormatEntity::Entry::FunctionIsOptimized, lldb_private::FormatEntity::Entry::FunctionLineOffset, lldb_private::FormatEntity::Entry::FunctionMangledName, lldb_private::FormatEntity::Entry::FunctionName, lldb_private::FormatEntity::Entry::FunctionNameNoArgs, lldb_private::FormatEntity::Entry::FunctionNameQualifiers, lldb_private::FormatEntity::Entry::FunctionNameWithArgs, lldb_private::FormatEntity::Entry::FunctionPCOffset, lldb_private::FormatEntity::Entry::FunctionPrefix, lldb_private::FormatEntity::Entry::FunctionQualifiers, lldb_private::FormatEntity::Entry::FunctionReturnLeft, lldb_private::FormatEntity::Entry::FunctionReturnRight, lldb_private::FormatEntity::Entry::FunctionScope, lldb_private::FormatEntity::Entry::FunctionSuffix, lldb_private::FormatEntity::Entry::FunctionTemplateArguments, lldb_private::Target::GetArchitecture(), lldb_private::ArchSpec::GetArchitectureName(), lldb_private::StackFrame::GetDisplayFunctionName(), lldb_private::Target::GetExecutableModulePointer(), lldb_private::StopInfo::GetExpressionVariable(), lldb_private::Module::GetFileSpec(), lldb_private::StackFrame::GetFrameCodeAddress(), lldb_private::StackFrame::GetFrameIndex(), lldb_private::Language::GetFunctionDisplayName(), lldb_private::StackFrame::GetFunctionName(), lldb_private::Process::GetID(), lldb_private::CompileUnit::GetLanguage(), lldb_private::GetLog(), lldb_private::Language::GetNameForLanguageType(), lldb_private::CompileUnit::GetPrimaryFile(), lldb_private::StopInfo::GetReturnValueObject(), lldb_private::StreamString::GetString(), lldb_private::Process::GetTarget(), lldb_private::Target::GetTargetFromContexts(), lldb_private::ArchSpec::GetTriple(), lldb_private::Debugger::GetUseColor(), lldb_private::Language::HandleFrameFormatVariable(), HandleFunctionNameWithArgs(), lldb_private::StackFrame::HasDebugInformation(), lldb_private::FormatEntity::Entry::Invalid, IsInvalidRecursiveFormat(), lldb_private::Address::IsValid(), lldb_private::ArchSpec::IsValid(), lldb_private::FormatEntity::Entry::Lang, lldb_private::FormatEntity::Entry::LineEntryColumn, lldb_private::FormatEntity::Entry::LineEntryEndAddress, lldb_private::FormatEntity::Entry::LineEntryFile, lldb_private::FormatEntity::Entry::LineEntryLineNumber, lldb_private::FormatEntity::Entry::LineEntryStartAddress, LLDB_INVALID_ADDRESS, LLDB_LOG, LLDB_REGNUM_GENERIC_FLAGS, LLDB_REGNUM_GENERIC_FP, LLDB_REGNUM_GENERIC_SP, m_addr, m_exe_ctx, m_function_changed, m_initial_function, m_sc, lldb_private::FormatEntity::Entry::ModuleFile, lldb_private::FormatEntity::Entry::number, lldb_private::FormatEntity::Entry::ParentNumber, lldb_private::FormatEntity::Entry::ParentString, pc, lldb_private::Stream::Printf(), lldb_private::FormatEntity::Entry::printf_format, lldb_private::FormatEntity::Entry::ProcessFile, lldb_private::FormatEntity::Entry::ProcessID, lldb_private::FormatEntity::Entry::ProgressCount, lldb_private::FormatEntity::Entry::ProgressMessage, PushEntryType(), lldb_private::Stream::PutCString(), lldb_private::FormatEntity::Entry::Root, RunScriptFormatKeyword(), lldb_private::FormatEntity::Entry::Scope, lldb_private::FormatEntity::Entry::ScriptFrame, lldb_private::FormatEntity::Entry::ScriptProcess, lldb_private::FormatEntity::Entry::ScriptTarget, lldb_private::FormatEntity::Entry::ScriptThread, lldb_private::FormatEntity::Entry::ScriptVariable, lldb_private::FormatEntity::Entry::ScriptVariableSynthetic, lldb_private::FormatEntity::Entry::Separator, lldb_private::Address::Slide(), lldb_private::FormatEntity::Entry::String, lldb_private::FormatEntity::Entry::string, lldb_private::FormatEntity::Entry::TargetArch, lldb_private::FormatEntity::Entry::TargetFile, lldb_private::FormatEntity::Entry::ThreadCompletedExpression, lldb_private::FormatEntity::Entry::ThreadID, lldb_private::FormatEntity::Entry::ThreadIndexID, lldb_private::FormatEntity::Entry::ThreadInfo, lldb_private::FormatEntity::Entry::ThreadName, lldb_private::FormatEntity::Entry::ThreadProtocolID, lldb_private::FormatEntity::Entry::ThreadQueue, lldb_private::FormatEntity::Entry::ThreadReturnValue, lldb_private::FormatEntity::Entry::ThreadStopReason, lldb_private::FormatEntity::Entry::ThreadStopReasonRaw, lldb_private::toString(), lldb_private::FormatEntity::Entry::type, lldb_private::FormatEntity::Entry::TypeToCString(), UINT64_MAX, lldb_private::FormatEntity::Entry::Variable, lldb_private::FormatEntity::Entry::VariableSynthetic, and lldb_private::Stream::Write().

Referenced by lldb_private::Thread::DumpUsingFormat(), DumpValue(), lldb_private::Debugger::FormatDisassemblerAddress(), lldb_private::StringSummaryFormat::FormatObject(), and lldb_private::Statusline::Redraw().

◆ FormatFunctionNameForLanguage()

bool FormatEntity::Formatter::FormatFunctionNameForLanguage ( Stream & s)
private

◆ FormatStringRef()

bool FormatEntity::Formatter::FormatStringRef ( const llvm::StringRef & format,
Stream & s,
ValueObject * valobj )

◆ IsInvalidRecursiveFormat()

bool FormatEntity::Formatter::IsInvalidRecursiveFormat ( Entry::Type type)
private

Returns true if Format has been called for an Entry with the specified type recusrively.

Some types are permitted to be formatted recursively, in which case this function returns false.

Definition at line 2717 of file FormatEntity.cpp.

References m_entry_type_stack, lldb_private::FormatEntity::Entry::Root, lldb_private::FormatEntity::Entry::Scope, and lldb_private::FormatEntity::Entry::Variable.

Referenced by Format().

◆ PushEntryType()

auto lldb_private::FormatEntity::Formatter::PushEntryType ( Entry::Type type)
inlineprivate

While the returned llvm::scope_exit is alive, the specified type is tracked by this Formatter object for recursion.

Once the returned scope guard is destructed, the entry stops being tracked.

Definition at line 261 of file FormatEntity.h.

References m_entry_type_stack.

Referenced by Format().

Member Data Documentation

◆ m_addr

const Address* const lldb_private::FormatEntity::Formatter::m_addr = nullptr
private

Definition at line 271 of file FormatEntity.h.

Referenced by Format(), and Formatter().

◆ m_entry_type_stack

llvm::SmallVector<Entry::Type, 1> lldb_private::FormatEntity::Formatter::m_entry_type_stack
private

Definition at line 275 of file FormatEntity.h.

Referenced by IsInvalidRecursiveFormat(), and PushEntryType().

◆ m_exe_ctx

const ExecutionContext* const lldb_private::FormatEntity::Formatter::m_exe_ctx = nullptr
private

Definition at line 270 of file FormatEntity.h.

Referenced by DumpValue(), Format(), and Formatter().

◆ m_function_changed

const bool lldb_private::FormatEntity::Formatter::m_function_changed = false
private

Definition at line 272 of file FormatEntity.h.

Referenced by Format(), and Formatter().

◆ m_initial_function

const bool lldb_private::FormatEntity::Formatter::m_initial_function = false
private

Definition at line 273 of file FormatEntity.h.

Referenced by Format(), and Formatter().

◆ m_sc

const SymbolContext* const lldb_private::FormatEntity::Formatter::m_sc = nullptr
private

Definition at line 269 of file FormatEntity.h.

Referenced by DumpValue(), Format(), FormatFunctionNameForLanguage(), and Formatter().


The documentation for this class was generated from the following files: