45 switch (encoding & 0x70)
51 result +=
reinterpret_cast<uint64_t
>(*addr);
55 ABORT(
"DW_EH_PE_textrel pointer encodings not supported");
59 ABORT(
"DW_EH_PE_datarel pointer encodings not supported");
63 ABORT(
"DW_EH_PE_funcrel pointer encodings not supported");
67 ABORT(
"DW_EH_PE_aligned pointer encodings not supported");
71 ABORT(
"unknown upper pointer encoding bits");
74 switch (encoding & 0x0F)
77 result += *
reinterpret_cast<uintptr_t *
>(*addr);
78 *addr +=
sizeof(
void *);
86 result += *
reinterpret_cast<uint16_t *
>(*addr);
87 *addr +=
sizeof(uint16_t);
91 result += *
reinterpret_cast<uint32_t *
>(*addr);
92 *addr +=
sizeof(uint32_t);
96 result += *
reinterpret_cast<uint64_t *
>(*addr);
97 *addr +=
sizeof(uint64_t);
105 result =
add_offset(result, *reinterpret_cast<int16_t *>(*addr));
106 *addr +=
sizeof(int16_t);
110 result =
add_offset(result, *reinterpret_cast<int32_t *>(*addr));
111 *addr +=
sizeof(int32_t);
115 result =
add_offset(result, *reinterpret_cast<int64_t *>(*addr));
116 *addr +=
sizeof(int64_t);
120 ABORT(
"unknown lower pointer encoding bits");
132 m_entry_start(nullptr),
133 m_entry_end(nullptr),
134 m_payload_start(nullptr),
135 m_payload_end(nullptr),
136 m_eh_frame{
nullptr, 0}
142 m_entry_start(nullptr),
143 m_entry_end(nullptr),
144 m_payload_start(nullptr),
145 m_payload_end(nullptr),
174 if (*reinterpret_cast<uint32_t *>(
m_entry_start) != 0xFFFFFFFF)
211 m_augmentation_string(nullptr),
214 m_return_address_reg(0),
215 m_pointer_encoding(0),
217 m_personality_encoding(0),
218 m_personality_function(0),
219 m_initial_instructions(nullptr)
226 m_augmentation_string(nullptr),
229 m_return_address_reg(0),
230 m_pointer_encoding(0),
232 m_personality_encoding(0),
233 m_personality_function(0),
234 m_initial_instructions(nullptr)
242 m_augmentation_string(nullptr),
245 m_return_address_reg(0),
246 m_pointer_encoding(0),
248 m_personality_encoding(0),
249 m_personality_function(0),
250 m_initial_instructions(nullptr)
274 p +=
sizeof(uint32_t);
275 p +=
sizeof(uint8_t);
308 ABORT(
"unknown augmentation string character");
324 m_instructions(nullptr)
334 m_instructions(nullptr)
345 m_instructions(nullptr)
368 auto p_cie =
reinterpret_cast<char *
>(
reinterpret_cast<uint64_t
>(p) - *reinterpret_cast<uint32_t *>(p));
371 p +=
sizeof(uint32_t);
395 ABORT(
"unknown augmentation string character");
414 for (
auto fde =
fd_entry(eh_frame_list[m]); fde; ++fde)
419 if (fde.is_in_range(state->
get_ip()))
424 log(
"ERROR: An exception was thrown, but the unwinder was unable to " 425 "locate a stack frame for RIP = %p. Possible reasons include\n",
426 reinterpret_cast<void *>(state->
get_ip()));
427 log(
" - Throwing from a destructor\n");
428 log(
" - Throwing from a function labeled noexcept\n");
429 log(
" - Bug in the unwinder\n");
430 log(
"\n\nAborting!!!\n\n")
void parse(char *addr) override
char augmentation_string(uint64_t index) const
void non_virtual_parse(char *addr)
uint64_t m_personality_function
uint64_t m_return_address_reg
static uint64_t decode_uleb128(char **addr)
uint64_t pointer_encoding() const
uint64_t m_pointer_encoding
struct eh_frame_t * get_eh_frame_list() noexcept
static int64_t decode_sleb128(char **addr)
virtual void dump() const
uint64_t decode_pointer(char **addr, uint64_t encoding)
char * m_initial_instructions
void parse(char *addr) override
void non_virtual_parse(char *addr)
uint64_t add_offset(uint64_t value, int64_t offset)
constexpr const auto addr
static fd_entry find_fde(register_state *state)
char * payload_start() const
uint64_t m_code_alignment
void non_virtual_parse(char *addr)
common_entry & operator++()
virtual void parse(char *addr)=0
const char * m_augmentation_string
virtual uint64_t get_ip() const
eh_frame_t eh_frame() const
uint64_t lsda_encoding() const
uint64_t m_personality_encoding