LLDB mainline
Public Member Functions | Private Attributes | List of all members
lldb_private::formatters::LibCxxUnorderedMapIteratorSyntheticFrontEnd Class Reference

Formats libcxx's std::unordered_map iterators. More...

#include <LibCxx.h>

Inheritance diagram for lldb_private::formatters::LibCxxUnorderedMapIteratorSyntheticFrontEnd:
Inheritance graph
[legend]

Public Member Functions

 LibCxxUnorderedMapIteratorSyntheticFrontEnd (lldb::ValueObjectSP valobj_sp)
 
 ~LibCxxUnorderedMapIteratorSyntheticFrontEnd () override=default
 
llvm::Expected< uint32_t > CalculateNumChildren () override
 
lldb::ValueObjectSP GetChildAtIndex (uint32_t idx) override
 
lldb::ChildCacheState Update () override
 This function is assumed to always succeed and if it fails, the front-end should know to deal with it in the correct way (most probably, by refusing to return any children).
 
bool MightHaveChildren () override
 
size_t GetIndexOfChildWithName (ConstString name) override
 
- Public Member Functions inherited from lldb_private::SyntheticChildrenFrontEnd
 SyntheticChildrenFrontEnd (ValueObject &backend)
 
virtual ~SyntheticChildrenFrontEnd ()=default
 
virtual llvm::Expected< uint32_t > CalculateNumChildren ()=0
 
virtual llvm::Expected< uint32_t > CalculateNumChildren (uint32_t max)
 
uint32_t CalculateNumChildrenIgnoringErrors (uint32_t max=UINT32_MAX)
 
virtual lldb::ValueObjectSP GetChildAtIndex (uint32_t idx)=0
 
virtual size_t GetIndexOfChildWithName (ConstString name)=0
 
virtual lldb::ChildCacheState Update ()=0
 This function is assumed to always succeed and if it fails, the front-end should know to deal with it in the correct way (most probably, by refusing to return any children).
 
virtual bool MightHaveChildren ()=0
 
virtual lldb::ValueObjectSP GetSyntheticValue ()
 
virtual ConstString GetSyntheticTypeName ()
 

Private Attributes

ValueObjectm_iter_ptr = nullptr
 Held, not owned.
 
lldb::ValueObjectSP m_pair_sp
 ValueObject for the key/value pair that the iterator currently points to.
 

Additional Inherited Members

- Public Types inherited from lldb_private::SyntheticChildrenFrontEnd
typedef std::shared_ptr< SyntheticChildrenFrontEndSharedPointer
 
typedef std::unique_ptr< SyntheticChildrenFrontEndAutoPointer
 
- Protected Member Functions inherited from lldb_private::SyntheticChildrenFrontEnd
void SetValid (bool valid)
 
bool IsValid ()
 
lldb::ValueObjectSP CreateValueObjectFromExpression (llvm::StringRef name, llvm::StringRef expression, const ExecutionContext &exe_ctx)
 
lldb::ValueObjectSP CreateValueObjectFromAddress (llvm::StringRef name, uint64_t address, const ExecutionContext &exe_ctx, CompilerType type)
 
lldb::ValueObjectSP CreateValueObjectFromData (llvm::StringRef name, const DataExtractor &data, const ExecutionContext &exe_ctx, CompilerType type)
 
- Protected Attributes inherited from lldb_private::SyntheticChildrenFrontEnd
ValueObjectm_backend
 

Detailed Description

Formats libcxx's std::unordered_map iterators.

In raw form a std::unordered_map::iterator is represented as follows:

(lldb) var it –raw –ptr-depth 1 (std::__1::__hash_map_iterator< std::__1::__hash_iterator< std::__1::__hash_node< std::__1::__hash_value_type< std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, void *> *> >) it = { __i_ = { __node_ = 0x0000600001700040 { __next_ = 0x0000600001704000 } } }

Definition at line 135 of file LibCxx.h.

Constructor & Destructor Documentation

◆ LibCxxUnorderedMapIteratorSyntheticFrontEnd()

lldb_private::formatters::LibCxxUnorderedMapIteratorSyntheticFrontEnd::LibCxxUnorderedMapIteratorSyntheticFrontEnd ( lldb::ValueObjectSP  valobj_sp)

Definition at line 396 of file LibCxx.cpp.

References Update().

◆ ~LibCxxUnorderedMapIteratorSyntheticFrontEnd()

lldb_private::formatters::LibCxxUnorderedMapIteratorSyntheticFrontEnd::~LibCxxUnorderedMapIteratorSyntheticFrontEnd ( )
overridedefault

Member Function Documentation

◆ CalculateNumChildren()

llvm::Expected< uint32_t > lldb_private::formatters::LibCxxUnorderedMapIteratorSyntheticFrontEnd::CalculateNumChildren ( )
overridevirtual

Implements lldb_private::SyntheticChildrenFrontEnd.

Definition at line 512 of file LibCxx.cpp.

◆ GetChildAtIndex()

lldb::ValueObjectSP lldb_private::formatters::LibCxxUnorderedMapIteratorSyntheticFrontEnd::GetChildAtIndex ( uint32_t  idx)
overridevirtual

Implements lldb_private::SyntheticChildrenFrontEnd.

Definition at line 517 of file LibCxx.cpp.

◆ GetIndexOfChildWithName()

size_t lldb_private::formatters::LibCxxUnorderedMapIteratorSyntheticFrontEnd::GetIndexOfChildWithName ( ConstString  name)
overridevirtual

Implements lldb_private::SyntheticChildrenFrontEnd.

Definition at line 529 of file LibCxx.cpp.

References UINT32_MAX.

◆ MightHaveChildren()

bool lldb_private::formatters::LibCxxUnorderedMapIteratorSyntheticFrontEnd::MightHaveChildren ( )
overridevirtual

Implements lldb_private::SyntheticChildrenFrontEnd.

Definition at line 524 of file LibCxx.cpp.

◆ Update()

lldb::ChildCacheState lldb_private::formatters::LibCxxUnorderedMapIteratorSyntheticFrontEnd::Update ( )
overridevirtual

This function is assumed to always succeed and if it fails, the front-end should know to deal with it in the correct way (most probably, by refusing to return any children).

The return value of Update should actually be interpreted as "ValueObjectSyntheticFilter cache is good/bad". If this function returns lldb::ChildCacheState::eReuse, ValueObjectSyntheticFilter is allowed to use the children it fetched previously and cached. Otherwise, ValueObjectSyntheticFilter must throw away its cache, and query again for children.

Implements lldb_private::SyntheticChildrenFrontEnd.

Definition at line 403 of file LibCxx.cpp.

References lldb_private::ValueObject::GetValueForExpressionPathOptions::DontCheckDotVsArrowSyntax(), lldb_private::CompilerType::TypeSystemSPWrapper::dyn_cast_or_null(), lldb::eBasicTypeUnsignedLongLong, lldb::eBasicTypeVoid, lldb::eRefetch, error(), lldb_private::CompilerType::GetByteSize(), lldb_private::CompilerType::GetFieldAtIndex(), lldb_private::CompilerType::GetTypeSystem(), lldb_private::CompilerType::GetTypeTemplateArgument(), LLDB_INVALID_ADDRESS, and lldb_private::ValueObject::GetValueForExpressionPathOptions::SetSyntheticChildrenTraversal().

Referenced by LibCxxUnorderedMapIteratorSyntheticFrontEnd().

Member Data Documentation

◆ m_iter_ptr

ValueObject* lldb_private::formatters::LibCxxUnorderedMapIteratorSyntheticFrontEnd::m_iter_ptr = nullptr
private

Held, not owned.

Child of iterator ValueObject supplied at construction.

Definition at line 153 of file LibCxx.h.

◆ m_pair_sp

lldb::ValueObjectSP lldb_private::formatters::LibCxxUnorderedMapIteratorSyntheticFrontEnd::m_pair_sp
private

ValueObject for the key/value pair that the iterator currently points to.

Definition at line 156 of file LibCxx.h.


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