LLDB mainline
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes | List of all members
lldb_private::plugin::dwarf::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 (DataEncoder &encoder) const
 Encode this object into a data encoder object.
 

Static Public Member Functions

static std::optional< DIERefDecode (const 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 30 of file DIERef.h.

Member Enumeration Documentation

◆ Section

Enumerator
DebugInfo 
DebugTypes 

Definition at line 32 of file DIERef.h.

Constructor & Destructor Documentation

◆ DIERef() [1/2]

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

Definition at line 33 of file DIERef.h.

References file_index().

◆ DIERef() [2/2]

lldb_private::plugin::dwarf::DIERef::DIERef ( lldb::user_id_t  uid)
inlineexplicit

Member Function Documentation

◆ Decode()

std::optional< DIERef > DIERef::Decode ( const 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 27 of file DIERef.cpp.

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

Referenced by lldb_private::plugin::dwarf::NameToDIE::Decode().

◆ die_offset()

dw_offset_t lldb_private::plugin::dwarf::DIERef::die_offset ( ) const
inline

◆ Encode()

void DIERef::Encode ( 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 39 of file DIERef.cpp.

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

◆ file_index()

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

◆ get_id()

lldb::user_id_t lldb_private::plugin::dwarf::DIERef::get_id ( ) const
inline

◆ operator!=()

bool lldb_private::plugin::dwarf::DIERef::operator!= ( const DIERef rhs) const
inline

Definition at line 84 of file DIERef.h.

◆ operator<()

bool lldb_private::plugin::dwarf::DIERef::operator< ( DIERef  other) const
inline

Definition at line 69 of file DIERef.h.

References m_die_offset, m_file_index, m_file_index_valid, and m_section.

◆ operator==()

bool lldb_private::plugin::dwarf::DIERef::operator== ( const DIERef rhs) const
inline

Definition at line 79 of file DIERef.h.

References file_index(), m_die_offset, and m_section.

◆ section()

Section lldb_private::plugin::dwarf::DIERef::section ( ) const
inline

Member Data Documentation

◆ k_die_offset_bit_size

constexpr uint64_t lldb_private::plugin::dwarf::DIERef::k_die_offset_bit_size = DW_DIE_OFFSET_MAX_BITSIZE
staticconstexpr

Definition at line 110 of file DIERef.h.

Referenced by DIERef(), and get_id().

◆ k_die_offset_mask

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

Definition at line 120 of file DIERef.h.

Referenced by DIERef(), and get_id().

◆ k_file_index_bit_size

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

Definition at line 111 of file DIERef.h.

◆ k_file_index_mask

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

◆ k_file_index_valid_bit

constexpr uint64_t lldb_private::plugin::dwarf::DIERef::k_file_index_valid_bit
staticconstexpr
Initial value:
=
static constexpr uint64_t k_file_index_bit_size
Definition: DIERef.h:111

Definition at line 114 of file DIERef.h.

Referenced by DIERef(), and get_id().

◆ k_section_bit

constexpr uint64_t lldb_private::plugin::dwarf::DIERef::k_section_bit
staticconstexpr
Initial value:

Definition at line 116 of file DIERef.h.

Referenced by DIERef(), and get_id().

◆ m_die_offset

dw_offset_t lldb_private::plugin::dwarf::DIERef::m_die_offset
private

Definition at line 125 of file DIERef.h.

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

◆ m_file_index

dw_offset_t lldb_private::plugin::dwarf::DIERef::m_file_index
private

Definition at line 127 of file DIERef.h.

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

◆ m_file_index_valid

dw_offset_t lldb_private::plugin::dwarf::DIERef::m_file_index_valid
private

Definition at line 129 of file DIERef.h.

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

◆ m_section

dw_offset_t lldb_private::plugin::dwarf::DIERef::m_section
private

Definition at line 131 of file DIERef.h.

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


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