Data Structures | Macros | Functions
eh_frame.h File Reference

Go to the source code of this file.

Data Structures

class  eh_frame
 
class  common_entry
 
class  ci_entry
 
class  fd_entry
 

Macros

#define DW_EH_PE_absptr   0x00
 
#define DW_EH_PE_uleb128   0x01
 
#define DW_EH_PE_udata2   0x02
 
#define DW_EH_PE_udata4   0x03
 
#define DW_EH_PE_udata8   0x04
 
#define DW_EH_PE_sleb128   0x09
 
#define DW_EH_PE_sdata2   0x0A
 
#define DW_EH_PE_sdata4   0x0B
 
#define DW_EH_PE_sdata8   0x0C
 
#define DW_EH_PE_pcrel   0x10
 
#define DW_EH_PE_textrel   0x20
 
#define DW_EH_PE_datarel   0x30
 
#define DW_EH_PE_funcrel   0x40
 
#define DW_EH_PE_aligned   0x50
 
#define DW_EH_PE_omit   0xFF
 
#define DW_CFA_GNU_args_size   0x2E
 
#define DW_CFA_GNU_negative_offset_extended   0x2F
 

Functions

uint64_t decode_pointer (char **addr, uint64_t encoding)
 

Macro Definition Documentation

◆ DW_EH_PE_absptr

#define DW_EH_PE_absptr   0x00

Definition at line 98 of file eh_frame.h.

◆ DW_EH_PE_uleb128

#define DW_EH_PE_uleb128   0x01

Definition at line 99 of file eh_frame.h.

◆ DW_EH_PE_udata2

#define DW_EH_PE_udata2   0x02

Definition at line 100 of file eh_frame.h.

◆ DW_EH_PE_udata4

#define DW_EH_PE_udata4   0x03

Definition at line 101 of file eh_frame.h.

◆ DW_EH_PE_udata8

#define DW_EH_PE_udata8   0x04

Definition at line 102 of file eh_frame.h.

◆ DW_EH_PE_sleb128

#define DW_EH_PE_sleb128   0x09

Definition at line 103 of file eh_frame.h.

◆ DW_EH_PE_sdata2

#define DW_EH_PE_sdata2   0x0A

Definition at line 104 of file eh_frame.h.

◆ DW_EH_PE_sdata4

#define DW_EH_PE_sdata4   0x0B

Definition at line 105 of file eh_frame.h.

◆ DW_EH_PE_sdata8

#define DW_EH_PE_sdata8   0x0C

Definition at line 106 of file eh_frame.h.

◆ DW_EH_PE_pcrel

#define DW_EH_PE_pcrel   0x10

Definition at line 109 of file eh_frame.h.

◆ DW_EH_PE_textrel

#define DW_EH_PE_textrel   0x20

Definition at line 110 of file eh_frame.h.

◆ DW_EH_PE_datarel

#define DW_EH_PE_datarel   0x30

Definition at line 111 of file eh_frame.h.

◆ DW_EH_PE_funcrel

#define DW_EH_PE_funcrel   0x40

Definition at line 112 of file eh_frame.h.

◆ DW_EH_PE_aligned

#define DW_EH_PE_aligned   0x50

Definition at line 113 of file eh_frame.h.

◆ DW_EH_PE_omit

#define DW_EH_PE_omit   0xFF

Definition at line 116 of file eh_frame.h.

◆ DW_CFA_GNU_args_size

#define DW_CFA_GNU_args_size   0x2E

Definition at line 147 of file eh_frame.h.

◆ DW_CFA_GNU_negative_offset_extended

#define DW_CFA_GNU_negative_offset_extended   0x2F

Definition at line 148 of file eh_frame.h.

Function Documentation

◆ decode_pointer()

uint64_t decode_pointer ( char **  addr,
uint64_t  encoding 
)

Decode Pointer

Decodes a pointer located at addr, given the provided encoding scheme. The whole reason this function exists is that for most pointers in an executable, not all of the address bits are needed. For example, on a 64bit system, most executables are well under 1GB, and thus, the vast majority of address bits are not needed to relay an address. To save space, pointers are encoded, and this function provides the decoding logic.

Note that for 64bit, you are only likely to PC relative addressing. This is because in 64bit, all of the code is relocatable.

Parameters
addrthe location of the encoded pointer. Note that this takes a double pointer. This is because the total size of the pointer is not know until it is decoded. Therefore, this function not only decodes but it also advances the address based on the size of the pointer.
encodingthe scheme by which the pointer is encoded.
Returns
the resulting pointer

Definition at line 33 of file eh_frame.cpp.