Public Member Functions | Protected Member Functions
fd_entry Class Reference
Inheritance diagram for fd_entry:
common_entry

Public Member Functions

 fd_entry ()
 
 fd_entry (const eh_frame_t &eh_frame)
 
 fd_entry (const eh_frame_t &eh_frame, void *addr)
 
 ~fd_entry () override=default
 
 fd_entry (fd_entry &&) noexcept=default
 
 fd_entry (const fd_entry &)=default
 
fd_entryoperator= (fd_entry &&) noexcept=default
 
fd_entryoperator= (const fd_entry &)=default
 
bool is_in_range (uint64_t pc) const
 
uint64_t pc_begin () const
 
uint64_t pc_range () const
 
uint64_t lsda () const
 
char * instructions () const
 
const ci_entrycie () 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
 

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

Frame Description Entry

The FDE provides all of the instructions for restoring the state of the registers when unwinding the stack. There is one FDE for each call frame that is created by the compiler (which is usually a function, but can include more than just functions in practice).

Definition at line 510 of file eh_frame.h.

Constructor & Destructor Documentation

◆ fd_entry() [1/5]

fd_entry::fd_entry ( )

Default Constructor

Creates an invalid FDE

Definition at line 320 of file eh_frame.cpp.

◆ fd_entry() [2/5]

fd_entry::fd_entry ( const eh_frame_t eh_frame)
explicit

Constructor

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

Definition at line 328 of file eh_frame.cpp.

◆ fd_entry() [3/5]

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

Constructor

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

Definition at line 339 of file eh_frame.cpp.

◆ ~fd_entry()

fd_entry::~fd_entry ( )
overridedefault

Destructor

◆ fd_entry() [4/5]

fd_entry::fd_entry ( fd_entry &&  )
defaultnoexcept

Default Move Constructor

◆ fd_entry() [5/5]

fd_entry::fd_entry ( const fd_entry )
default

Default Copy Constructor

Member Function Documentation

◆ operator=() [1/2]

fd_entry& fd_entry::operator= ( fd_entry &&  )
defaultnoexcept

Default Move Assignment Operator

◆ operator=() [2/2]

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

Default Copy Assignment Operator

◆ is_in_range()

bool fd_entry::is_in_range ( uint64_t  pc) const
inline

Is PC In Range

Note: the range for the PC is not 0 indexed (fails if you attempt to code this as >= && < instead of > && <=). The test case is a function that does nothing but throws. The compiler will emit code without an epilogue, and the range will include the address of the next instruction which is the start of another function.

Parameters
pcthe program counter (on x86_64 this is rip) to test
Returns
returns true if this FDE contains the instructions for the PC provided.

Definition at line 566 of file eh_frame.h.

◆ pc_begin()

uint64_t fd_entry::pc_begin ( ) const
inline

PC Begin

Returns
returns the beginning of the FDE's range

Definition at line 573 of file eh_frame.h.

◆ pc_range()

uint64_t fd_entry::pc_range ( ) const
inline

PC Range

Returns
returns the range of the FDE

Definition at line 580 of file eh_frame.h.

◆ lsda()

uint64_t fd_entry::lsda ( ) const
inline

LSDA Location

Returns
returns the location of the LSDA given the encoding defined in the CIE

Definition at line 588 of file eh_frame.h.

◆ instructions()

char* fd_entry::instructions ( ) const
inline

Instructions

Returns
returns the location of the DWARF instructions that define how to unwind the CFA that this FDE defines.

Definition at line 596 of file eh_frame.h.

◆ cie()

const ci_entry& fd_entry::cie ( ) const
inline

CIE

Returns
returns the CIE associated with this FDE.

Definition at line 603 of file eh_frame.h.

◆ parse()

void fd_entry::parse ( char *  addr)
overrideprotectedvirtual

Implements common_entry.

Definition at line 351 of file eh_frame.cpp.

◆ non_virtual_parse()

void fd_entry::non_virtual_parse ( char *  addr)
protected

Definition at line 357 of file eh_frame.cpp.


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