Public Member Functions
register_state Class Reference
Inheritance diagram for register_state:
register_state_intel_x64

Public Member Functions

 register_state ()=default
 
virtual ~register_state ()=default
 
 register_state (register_state &&) noexcept=default
 
 register_state (const register_state &)=default
 
register_stateoperator= (register_state &&) noexcept=default
 
register_stateoperator= (const register_state &)=default
 
virtual uint64_t get_ip () const
 
virtual register_stateset_ip (uint64_t value)
 
virtual uint64_t get (uint64_t index) const
 
virtual register_stateset (uint64_t index, uint64_t value)
 
virtual void commit ()
 
virtual void commit (uint64_t cfa)
 
virtual void resume ()
 
virtual uint64_t max_num_registers () const
 
virtual const char * name (uint64_t index) const
 
virtual void dump () const
 

Detailed Description

Register State

Defines the state of the registers. When the unwinder first starts, it will get the state of the registers as its first operation. From that point it will locate the FDE associated with the instruction pointer, and unwind the stack. The process of unwinding the stack is to change the register state stored here, which at a minimum changes the instruction pointer and the stack register (but likely also changes other registers). From there the next FDE is located, and the process repeats until the personality function says when to stop

Once the "catch" block is found, the register state can be used to resume into a new CFA by loading the register state.

Definition at line 43 of file registers.h.

Constructor & Destructor Documentation

◆ register_state() [1/3]

register_state::register_state ( )
default

Default Constructor

◆ ~register_state()

virtual register_state::~register_state ( )
virtualdefault

Destructor

◆ register_state() [2/3]

register_state::register_state ( register_state &&  )
defaultnoexcept

Default Move Constructor

◆ register_state() [3/3]

register_state::register_state ( const register_state )
default

Default Copy Constructor

Member Function Documentation

◆ operator=() [1/2]

register_state& register_state::operator= ( register_state &&  )
defaultnoexcept

Default Move Assignment Operator

◆ operator=() [2/2]

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

Default Copy Assignment Operator

◆ get_ip()

virtual uint64_t register_state::get_ip ( ) const
inlinevirtual

Get Instruction Pointer

Returns
returns the instruction pointer value

Reimplemented in register_state_intel_x64.

Definition at line 75 of file registers.h.

◆ set_ip()

virtual register_state& register_state::set_ip ( uint64_t  value)
inlinevirtual

Set Instruction Pointer

Note: the write is staged and must be committed using the commit function

Parameters
valuethe value to set the instruction pointer to
Returns
returns this register state for chaining

Reimplemented in register_state_intel_x64.

Definition at line 86 of file registers.h.

◆ get()

virtual uint64_t register_state::get ( uint64_t  index) const
inlinevirtual

Get General Purpose Register

Parameters
indexthe general purpose register to get
Returns
returns the value of the general purpose register requested

Reimplemented in register_state_intel_x64.

Definition at line 94 of file registers.h.

◆ set()

virtual register_state& register_state::set ( uint64_t  index,
uint64_t  value 
)
inlinevirtual

Set General Purpose Register

Note: the write is staged and must be committed using the commit function

Parameters
indexthe general purpose register to set
valuethe value to set the general purpose register to
Returns
returns this register state for chaining

Reimplemented in register_state_intel_x64.

Definition at line 106 of file registers.h.

◆ commit() [1/2]

virtual void register_state::commit ( )
inlinevirtual

Commit

Commits any pending changes to the register state

Reimplemented in register_state_intel_x64.

Definition at line 113 of file registers.h.

◆ commit() [2/2]

virtual void register_state::commit ( uint64_t  cfa)
inlinevirtual

Commit with CFA

Commits any pending changes to the register state, and saves the provided cfa in the stack register

Parameters
cfathe canonical frame address to save to the stack register

Reimplemented in register_state_intel_x64.

Definition at line 123 of file registers.h.

◆ resume()

virtual void register_state::resume ( )
inlinevirtual

Resume

Restores the register state. Note that this function does not return.

Reimplemented in register_state_intel_x64.

Definition at line 130 of file registers.h.

◆ max_num_registers()

virtual uint64_t register_state::max_num_registers ( ) const
inlinevirtual

Max Number of Registers

Returns
returns the maximum number of registers that this register state stores. This is usually defined by the associated ABI

Reimplemented in register_state_intel_x64.

Definition at line 138 of file registers.h.

◆ name()

virtual const char* register_state::name ( uint64_t  index) const
inlinevirtual

Register Name

Parameters
indexthe index of the register to get the name for
Returns
returns the name of the register requested

Reimplemented in register_state_intel_x64.

Definition at line 146 of file registers.h.

◆ dump()

virtual void register_state::dump ( ) const
inlinevirtual

Dump

Prints the value of each register. Make sure that logging is enabled before using this function

Reimplemented in register_state_intel_x64.

Definition at line 154 of file registers.h.


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