LLDB mainline
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":

  • file_index: identifies the separate stand alone debug info file that is referred to by the main debug info file. This will be the index of a DWO file for fission, or the .o file on mac when not using a dSYM file. If this field is not set, then this references a DIE inside the original object file.
  • section: identifies the section of the debug info entry in the given file: debug_info or debug_types.
  • die_offset: The offset of the debug info entry as an absolute offset from the beginning of the section specified in the section field.

Definition at line 31 of file DIERef.h.

Member Enumeration Documentation

◆ Section

Enumerator
DebugInfo 
DebugTypes 

Definition at line 33 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

◆ 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(), DIERef(), and lldb_private::DataExtractor::GetU64().

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

◆ die_offset()

◆ 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()

◆ 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 85 of file DIERef.h.

References DIERef().

◆ operator<()

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

Definition at line 70 of file DIERef.h.

References DIERef(), 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 80 of file DIERef.h.

References DIERef(), file_index(), m_die_offset, and m_section.

◆ section()

Member Data Documentation

◆ k_die_offset_bit_size

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

Definition at line 111 of file DIERef.h.

Referenced by DIERef(), and get_id().

◆ k_die_offset_mask

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:111

Definition at line 121 of file DIERef.h.

Referenced by DIERef(), and get_id().

◆ k_file_index_bit_size

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

Definition at line 112 of file DIERef.h.

◆ k_file_index_mask

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

◆ k_file_index_valid_bit

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:112

Definition at line 115 of file DIERef.h.

Referenced by DIERef(), and get_id().

◆ k_section_bit

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

Definition at line 117 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 126 of file DIERef.h.

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

◆ m_file_index

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

Definition at line 128 of file DIERef.h.

Referenced by DIERef(), 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 130 of file DIERef.h.

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

◆ m_section

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

Definition at line 132 of file DIERef.h.

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


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