LLDB mainline
lldb_private::plugin::dwarf::NameToDIE Class Reference

#include <NameToDIE.h>

Public Member Functions

 NameToDIE ()
 ~NameToDIE ()=default
void Dump (Stream *s)
void Insert (ConstString name, const DIERef &die_ref)
void Append (const NameToDIE &other)
void Finalize ()
bool Find (ConstString name, llvm::function_ref< IterationAction(DIERef ref)> callback) const
bool Find (const RegularExpression &regex, llvm::function_ref< IterationAction(DIERef ref)> callback) const
void FindAllEntriesForUnit (DWARFUnit &unit, llvm::function_ref< IterationAction(DIERef ref)> callback) const
 unit must be the skeleton unit if possible, not GetNonSkeletonUnit().
void ForEach (std::function< bool(ConstString name, const DIERef &die_ref)> const &callback) const
bool Decode (const DataExtractor &data, lldb::offset_t *offset_ptr, const StringTableReader &strtab)
 Decode a serialized version of this object from data.
void Encode (DataEncoder &encoder, ConstStringTable &strtab) const
 Encode this object into a data encoder object.
bool operator== (const NameToDIE &rhs) const
 Used for unit testing the encoding and decoding.
bool IsEmpty () const
void Clear ()

Protected Attributes

UniqueCStringMap< DIERefm_map

Detailed Description

Definition at line 24 of file NameToDIE.h.

Constructor & Destructor Documentation

◆ NameToDIE()

lldb_private::plugin::dwarf::NameToDIE::NameToDIE ( )
inline

Definition at line 26 of file NameToDIE.h.

References m_map.

Referenced by Append(), operator==(), and ~NameToDIE().

◆ ~NameToDIE()

lldb_private::plugin::dwarf::NameToDIE::~NameToDIE ( )
default

References NameToDIE().

Member Function Documentation

◆ Append()

void NameToDIE::Append ( const NameToDIE & other)

Definition at line 91 of file NameToDIE.cpp.

References m_map, and NameToDIE().

Referenced by lldb_private::plugin::dwarf::ManualDWARFIndex::Index().

◆ Clear()

void lldb_private::plugin::dwarf::NameToDIE::Clear ( )
inline

Definition at line 87 of file NameToDIE.h.

References m_map.

◆ Decode()

bool NameToDIE::Decode ( const DataExtractor & data,
lldb::offset_t * offset_ptr,
const StringTableReader & strtab )

Decode a serialized version of this object from data.

Parameters
dataThe decoder object that references the serialized data.
offset_ptrA pointer that contains the offset from which the data will be decoded from that gets updated as data gets decoded.
strtabAll strings in cache files are put into string tables for efficiency and cache file size reduction. Strings are stored as uint32_t string table offsets in the cache data.

Definition at line 101 of file NameToDIE.cpp.

References lldb_private::plugin::dwarf::DIERef::Decode(), lldb_private::StringTableReader::Get(), lldb_private::DataExtractor::GetData(), lldb_private::DataExtractor::GetU32(), kIdentifierNameToDIE(), and m_map.

◆ Dump()

void NameToDIE::Dump ( Stream * s)

Definition at line 72 of file NameToDIE.cpp.

References lldb_private::Stream::Format(), and m_map.

◆ Encode()

void NameToDIE::Encode ( DataEncoder & encoder,
ConstStringTable & strtab ) const

Encode this object into a data encoder object.

This allows this object to be serialized to disk.

Parameters
encoderA data encoder object that serialized bytes will be encoded into.
strtabAll strings in cache files are put into string tables for efficiency and cache file size reduction. Strings are stored as uint32_t string table offsets in the cache data.

Definition at line 132 of file NameToDIE.cpp.

References lldb_private::ConstStringTable::Add(), lldb_private::DataEncoder::AppendData(), lldb_private::DataEncoder::AppendU32(), kIdentifierNameToDIE(), and m_map.

◆ Finalize()

void NameToDIE::Finalize ( )

Definition at line 26 of file NameToDIE.cpp.

References m_map.

Referenced by lldb_private::plugin::dwarf::ManualDWARFIndex::Index().

◆ Find() [1/2]

bool NameToDIE::Find ( const RegularExpression & regex,
llvm::function_ref< IterationAction(DIERef ref)> callback ) const

◆ Find() [2/2]

bool NameToDIE::Find ( ConstString name,
llvm::function_ref< IterationAction(DIERef ref)> callback ) const

Definition at line 35 of file NameToDIE.cpp.

References m_map, and lldb_private::Stop.

◆ FindAllEntriesForUnit()

◆ ForEach()

void NameToDIE::ForEach ( std::function< bool(ConstString name, const DIERef &die_ref)> const & callback) const

Definition at line 80 of file NameToDIE.cpp.

References m_map.

◆ Insert()

void NameToDIE::Insert ( ConstString name,
const DIERef & die_ref )

Definition at line 31 of file NameToDIE.cpp.

References m_map.

◆ IsEmpty()

bool lldb_private::plugin::dwarf::NameToDIE::IsEmpty ( ) const
inline

Definition at line 85 of file NameToDIE.h.

References m_map.

◆ operator==()

bool NameToDIE::operator== ( const NameToDIE & rhs) const

Used for unit testing the encoding and decoding.

Definition at line 143 of file NameToDIE.cpp.

References m_map, and NameToDIE().

Member Data Documentation

◆ m_map

UniqueCStringMap<DIERef> lldb_private::plugin::dwarf::NameToDIE::m_map
protected

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