LLDB mainline
Public Member Functions | Protected Attributes | List of all members
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< bool(DIERef ref)> callback) const
 
bool Find (const RegularExpression &regex, llvm::function_ref< bool(DIERef ref)> callback) const
 
void FindAllEntriesForUnit (DWARFUnit &unit, llvm::function_ref< bool(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 23 of file NameToDIE.h.

Constructor & Destructor Documentation

◆ NameToDIE()

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

Definition at line 25 of file NameToDIE.h.

◆ ~NameToDIE()

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

Member Function Documentation

◆ Append()

void NameToDIE::Append ( const NameToDIE other)

Definition at line 87 of file NameToDIE.cpp.

References m_map.

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

◆ Clear()

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

Definition at line 86 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 97 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.

Referenced by lldb_private::plugin::dwarf::ManualDWARFIndex::IndexSet::Decode().

◆ Dump()

void NameToDIE::Dump ( Stream s)

◆ 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 128 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 25 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< bool(DIERef ref)>  callback 
) const

Definition at line 42 of file NameToDIE.cpp.

References lldb_private::RegularExpression::Execute(), and m_map.

◆ Find() [2/2]

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

◆ FindAllEntriesForUnit()

void NameToDIE::FindAllEntriesForUnit ( DWARFUnit unit,
llvm::function_ref< bool(DIERef ref)>  callback 
) const

◆ ForEach()

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

Definition at line 76 of file NameToDIE.cpp.

References m_map.

◆ Insert()

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

Definition at line 30 of file NameToDIE.cpp.

References m_map.

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

◆ IsEmpty()

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

Definition at line 84 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 139 of file NameToDIE.cpp.

References m_map.

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: