LLDB mainline
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes | List of all members
DIERef Class Reference

Identifies a DWARF debug info entry within a given Module. More...

#include <DIERef.h>

Public Types

enum  Section : uint8_t { DebugInfo , DebugTypes }
 

Public Member Functions

 DIERef (std::optional< uint32_t > file_index, Section section, dw_offset_t die_offset)
 
 DIERef (lldb::user_id_t uid)
 
lldb::user_id_t get_id () const
 
std::optional< uint32_t > file_index () const
 
Section section () const
 
dw_offset_t die_offset () const
 
bool operator< (DIERef other) const
 
bool operator== (const DIERef &rhs) const
 
bool operator!= (const DIERef &rhs) const
 
void Encode (lldb_private::DataEncoder &encoder) const
 Encode this object into a data encoder object.
 

Static Public Member Functions

static std::optional< DIERefDecode (const lldb_private::DataExtractor &data, lldb::offset_t *offset_ptr)
 Decode a serialized version of this object from data.
 

Static Public Attributes

static constexpr uint64_t k_die_offset_bit_size = DW_DIE_OFFSET_MAX_BITSIZE
 
static constexpr uint64_t k_file_index_bit_size
 
static constexpr uint64_t k_file_index_valid_bit
 
static constexpr uint64_t k_section_bit
 
static constexpr uint64_t k_file_index_mask = (~0ull) >> (64 - k_file_index_bit_size)
 
static constexpr uint64_t k_die_offset_mask
 

Private Attributes

dw_offset_t m_die_offset: k_die_offset_bit_size
 
dw_offset_t m_file_index: k_file_index_bit_size
 
dw_offset_t m_file_index_valid: 1
 
dw_offset_t m_section: 1
 

Detailed Description

Identifies a DWARF debug info entry within a given Module.

It contains three "coordinates":

Definition at line 28 of file DIERef.h.

Member Enumeration Documentation

◆ Section

enum DIERef::Section : uint8_t
Enumerator
DebugInfo 
DebugTypes 

Definition at line 30 of file DIERef.h.

Constructor & Destructor Documentation

◆ DIERef() [1/2]

DIERef::DIERef ( std::optional< uint32_t >  file_index,
Section  section,
dw_offset_t  die_offset 
)
inline

Definition at line 31 of file DIERef.h.

References file_index().

◆ DIERef() [2/2]

DIERef::DIERef ( lldb::user_id_t  uid)
inlineexplicit

Member Function Documentation

◆ Decode()

std::optional< DIERef > DIERef::Decode ( const lldb_private::DataExtractor data,
lldb::offset_t offset_ptr 
)
static

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.
Returns
Returns a valid DIERef if decoding succeeded, std::nullopt if there was unsufficient or invalid values that were decoded.

Definition at line 26 of file DIERef.cpp.

References die_offset(), and lldb_private::DataExtractor::GetU64().

Referenced by NameToDIE::Decode().

◆ die_offset()

dw_offset_t DIERef::die_offset ( ) const
inline

◆ Encode()

void DIERef::Encode ( lldb_private::DataEncoder encoder) 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.

Definition at line 38 of file DIERef.cpp.

References lldb_private::DataEncoder::AppendU64(), and get_id().

◆ file_index()

std::optional< uint32_t > DIERef::file_index ( ) const
inline

◆ get_id()

lldb::user_id_t DIERef::get_id ( ) const
inline

◆ operator!=()

bool DIERef::operator!= ( const DIERef rhs) const
inline

Definition at line 82 of file DIERef.h.

◆ operator<()

bool DIERef::operator< ( DIERef  other) const
inline

Definition at line 67 of file DIERef.h.

References m_die_offset, m_file_index, m_file_index_valid, and m_section.

◆ operator==()

bool DIERef::operator== ( const DIERef rhs) const
inline

Definition at line 77 of file DIERef.h.

References file_index(), m_die_offset, and m_section.

◆ section()

Section DIERef::section ( ) const
inline

Member Data Documentation

◆ k_die_offset_bit_size

constexpr uint64_t DIERef::k_die_offset_bit_size = DW_DIE_OFFSET_MAX_BITSIZE
staticconstexpr

Definition at line 108 of file DIERef.h.

Referenced by DIERef(), and get_id().

◆ k_die_offset_mask

constexpr uint64_t DIERef::k_die_offset_mask
staticconstexpr
Initial value:
= (~0ull) >>
static constexpr uint64_t k_die_offset_bit_size
Definition: DIERef.h:108

Definition at line 118 of file DIERef.h.

Referenced by DIERef(), and get_id().

◆ k_file_index_bit_size

constexpr uint64_t DIERef::k_file_index_bit_size
staticconstexpr
Initial value:
=
#define DW_DIE_OFFSET_MAX_BITSIZE
Definition: dwarf.h:35

Definition at line 109 of file DIERef.h.

◆ k_file_index_mask

constexpr uint64_t DIERef::k_file_index_mask = (~0ull) >> (64 - k_file_index_bit_size)
staticconstexpr

Definition at line 117 of file DIERef.h.

Referenced by DIERef(), SymbolFileDWARF::GetDIE(), and SymbolFileDWARF::GetDwpSymbolFile().

◆ k_file_index_valid_bit

constexpr uint64_t DIERef::k_file_index_valid_bit
staticconstexpr
Initial value:
=
static constexpr uint64_t k_file_index_bit_size
Definition: DIERef.h:109

Definition at line 112 of file DIERef.h.

Referenced by DIERef(), and get_id().

◆ k_section_bit

constexpr uint64_t DIERef::k_section_bit
staticconstexpr
Initial value:

Definition at line 114 of file DIERef.h.

Referenced by DIERef(), and get_id().

◆ m_die_offset

dw_offset_t DIERef::m_die_offset
private

Definition at line 123 of file DIERef.h.

Referenced by die_offset(), DIERef(), get_id(), operator<(), and operator==().

◆ m_file_index

dw_offset_t DIERef::m_file_index
private

Definition at line 125 of file DIERef.h.

Referenced by DIERef(), file_index(), and operator<().

◆ m_file_index_valid

dw_offset_t DIERef::m_file_index_valid
private

Definition at line 127 of file DIERef.h.

Referenced by DIERef(), file_index(), get_id(), and operator<().

◆ m_section

dw_offset_t DIERef::m_section
private

Definition at line 129 of file DIERef.h.

Referenced by DIERef(), operator<(), operator==(), and section().


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