Public Member Functions | Data Fields | Protected Member Functions
ci_entry Class Reference
Inheritance diagram for ci_entry:
common_entry

Public Member Functions

 ci_entry ()
 
 ci_entry (const eh_frame_t &eh_frame)
 
 ci_entry (const eh_frame_t &eh_frame, void *addr)
 
 ~ci_entry () override=default
 
 ci_entry (ci_entry &&) noexcept=default
 
 ci_entry (const ci_entry &)=default
 
ci_entryoperator= (ci_entry &&) noexcept=default
 
ci_entryoperator= (const ci_entry &)=default
 
char augmentation_string (uint64_t index) const
 
uint64_t code_alignment () const
 
int64_t data_alignment () const
 
uint64_t return_address_reg () const
 
uint64_t pointer_encoding () const
 
uint64_t lsda_encoding () const
 
uint64_t personality_encoding () const
 
uint64_t personality_function () const
 
char * initial_instructions () const
 
- Public Member Functions inherited from common_entry
 common_entry ()
 
 common_entry (const eh_frame_t &eh_frame)
 
virtual ~common_entry ()=default
 
 common_entry (common_entry &&) noexcept=default
 
 common_entry (const common_entry &)=default
 
common_entryoperator= (common_entry &&) noexcept=default
 
common_entryoperator= (const common_entry &)=default
 
common_entryoperator++ ()
 
 operator bool () const
 
bool is_cie () const
 
bool is_fde () const
 
char * entry_start () const
 
char * entry_end () const
 
char * payload_start () const
 
char * payload_end () const
 
eh_frame_t eh_frame () const
 

Data Fields

const char * m_augmentation_string
 
uint64_t m_code_alignment
 
int64_t m_data_alignment
 
uint64_t m_return_address_reg
 
uint64_t m_pointer_encoding
 
uint64_t m_lsda_encoding
 
uint64_t m_personality_encoding
 
uint64_t m_personality_function
 
char * m_initial_instructions
 

Protected Member Functions

void parse (char *addr) override
 
void non_virtual_parse (char *addr)
 
- Protected Member Functions inherited from common_entry
void non_virtual_parse (char *addr)
 

Additional Inherited Members

- Protected Attributes inherited from common_entry
bool m_is_cie
 
char * m_entry_start
 
char * m_entry_end
 
char * m_payload_start
 
char * m_payload_end
 
eh_frame_t m_eh_frame
 

Detailed Description

Common Information Entry

The goal of the CIE is to provide a set of DWARF instructions that are the same for all FDEs (at least this is how it is documented). What this really means is each CIE defines a different function prolog that the compiler has, and there are not many of them. The CIE also contains other information that is shared by all of the FDEs, like the personality function, and the location of the LSDA, and the different encoding types.

When parsing the .eh_frame section, it's best to actually skip over the CIEs and only look for FDEs. Once you have the FDE you want, you can use the pointer in the FDE to locate the CIE associated with that FDE.

Definition at line 360 of file eh_frame.h.

Constructor & Destructor Documentation

◆ ci_entry() [1/5]

ci_entry::ci_entry ( )

Default Constructor

Creates an invalid CIE

Definition at line 210 of file eh_frame.cpp.

◆ ci_entry() [2/5]

ci_entry::ci_entry ( const eh_frame_t eh_frame)
explicit

Constructor

Creates an invalid CIE, but stores the location of the beginning of the .eh_frame section.

Definition at line 223 of file eh_frame.cpp.

◆ ci_entry() [3/5]

ci_entry::ci_entry ( const eh_frame_t eh_frame,
void *  addr 
)
explicit

Constructor

Creates a valid CIE if the addr that is provided points to a valid CIE in the .eh_frame provided

Definition at line 239 of file eh_frame.cpp.

◆ ~ci_entry()

ci_entry::~ci_entry ( )
overridedefault

Destructor

◆ ci_entry() [4/5]

ci_entry::ci_entry ( ci_entry &&  )
defaultnoexcept

Default Move Constructor

◆ ci_entry() [5/5]

ci_entry::ci_entry ( const ci_entry )
default

Default Copy Constructor

Member Function Documentation

◆ operator=() [1/2]

ci_entry& ci_entry::operator= ( ci_entry &&  )
defaultnoexcept

Default Move Assignment Operator

◆ operator=() [2/2]

ci_entry& ci_entry::operator= ( const ci_entry )
default

Default Copy Assignment Operator

◆ augmentation_string()

char ci_entry::augmentation_string ( uint64_t  index) const
inline

Augmentation String

Each CIE can provide different types of information, and to provide a means to compress this information, the DWARF spec defines which fields each CIE/FDE actually provides using the augmentation string. Each character in the string defines what the next thing in the augmentation data portion of the CIE/FDE is. For more information on this, please see the specification.

Returns
pointer to the augmentation string

Definition at line 415 of file eh_frame.h.

◆ code_alignment()

uint64_t ci_entry::code_alignment ( ) const
inline

Code Alignment

Returns
returns how the code is aligned. On x86_64, this is usually just 1, which means it's pointless.

Definition at line 423 of file eh_frame.h.

◆ data_alignment()

int64_t ci_entry::data_alignment ( ) const
inline

Data Alignment

Returns
returns how the data is aligned. On x86_64, this is usually -8 bytes, which means that each register is 8 bytes, growing down from the CFA

Definition at line 432 of file eh_frame.h.

◆ return_address_reg()

uint64_t ci_entry::return_address_reg ( ) const
inline

Return Address Register

Returns
returns the instruction pointer register index. The System V 64bit ABI defines this as 16 (rip)

Definition at line 440 of file eh_frame.h.

◆ pointer_encoding()

uint64_t ci_entry::pointer_encoding ( ) const
inline

Pointer Encoding

Returns
returns how each pointer is encoded. This is defined by the eh_frame spec (not the DWARF spec) and is usually a PC relative encoding, as x86_64 code is relocatable.

Definition at line 449 of file eh_frame.h.

◆ lsda_encoding()

uint64_t ci_entry::lsda_encoding ( ) const
inline

LSDA Encoding

Returns
returns how the LSDA is encoded

Definition at line 456 of file eh_frame.h.

◆ personality_encoding()

uint64_t ci_entry::personality_encoding ( ) const
inline

Personality Encoding

Returns
returns how the personality function's pointer is encoded.

Definition at line 463 of file eh_frame.h.

◆ personality_function()

uint64_t ci_entry::personality_function ( ) const
inline

Personality Function

Returns
returns a pointer to the personality function. The personality function tells the unwinder when to stop searching for the catch blocks

Definition at line 472 of file eh_frame.h.

◆ initial_instructions()

char* ci_entry::initial_instructions ( ) const
inline

Initial Instructions

Returns
returns a pointer to the initial DWARF instructions that usually define the function prologs that the compiler creates

Definition at line 480 of file eh_frame.h.

◆ parse()

void ci_entry::parse ( char *  addr)
overrideprotectedvirtual

Implements common_entry.

Definition at line 256 of file eh_frame.cpp.

◆ non_virtual_parse()

void ci_entry::non_virtual_parse ( char *  addr)
protected

Definition at line 262 of file eh_frame.cpp.

Field Documentation

◆ m_augmentation_string

const char* ci_entry::m_augmentation_string

Definition at line 488 of file eh_frame.h.

◆ m_code_alignment

uint64_t ci_entry::m_code_alignment

Definition at line 489 of file eh_frame.h.

◆ m_data_alignment

int64_t ci_entry::m_data_alignment

Definition at line 490 of file eh_frame.h.

◆ m_return_address_reg

uint64_t ci_entry::m_return_address_reg

Definition at line 491 of file eh_frame.h.

◆ m_pointer_encoding

uint64_t ci_entry::m_pointer_encoding

Definition at line 492 of file eh_frame.h.

◆ m_lsda_encoding

uint64_t ci_entry::m_lsda_encoding

Definition at line 493 of file eh_frame.h.

◆ m_personality_encoding

uint64_t ci_entry::m_personality_encoding

Definition at line 494 of file eh_frame.h.

◆ m_personality_function

uint64_t ci_entry::m_personality_function

Definition at line 495 of file eh_frame.h.

◆ m_initial_instructions

char* ci_entry::m_initial_instructions

Definition at line 496 of file eh_frame.h.


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