33 RELOCO_UNSAFE_BUFFER_USAGE
37 uint8_t personality = (unwind_word >> 24) & 0x0F;
40 if (personality == 0 || personality == 1) {
42 static_cast<uint8_t
>((unwind_word >> 16) & 0xFF),
43 static_cast<uint8_t
>((unwind_word >> 8) & 0xFF),
44 static_cast<uint8_t
>(unwind_word & 0xFF)
47 return parse_and_apply_bytes(space, io_sp, reg_ctx,
bytes);
67 RELOCO_UNSAFE_BUFFER_USAGE
69 const uint8_t bytes[3])
noexcept {
72 uint8_t opcode =
bytes[idx++];
83 if ((opcode & 0xC0) == 0x00) {
84 uint32_t offset = (
static_cast<uint32_t
>(opcode & 0x3F) << 2U) + 4U;
88 else if ((opcode & 0xC0) == 0x40) {
89 uint32_t offset = (
static_cast<uint32_t
>(opcode & 0x3F) << 2U) + 4U;
93 else if ((opcode & 0xF0) == 0x80) {
96 uint8_t low_mask =
bytes[idx++];
98 static_cast<uint16_t
>((
static_cast<uint16_t
>(opcode & 0x0F) << 8U) |
static_cast<uint16_t
>(low_mask));
100 for (
int i = 0; i < 12; ++i) {
101 if ((reg_mask & (1U <<
static_cast<unsigned>(i))) != 0) {
103 if (space.read_bytes(io_sp, &val, 4)) {
104 uint32_t dwarf_reg =
static_cast<uint32_t
>(dwarf::arm32::r4) +
static_cast<uint32_t
>(i);
105 if (!reg_ctx.write(dwarf_reg, val))
115 else if ((opcode & 0xF0) == 0x90 && opcode != 0x9D && opcode != 0x9F) {
116 uint32_t reg_val = 0;
117 uint32_t reg_num =
static_cast<uint32_t
>(opcode & 0x0F);
118 if (!reg_ctx.read(reg_num, reg_val))
123 else if ((opcode & 0xF0) == 0xA0) {
124 uint8_t count = opcode & 0x07;
125 bool pop_lr = (opcode & 0x08) != 0;
127 for (
int i = 0; i <= count; ++i, io_sp += 4) {
129 if (space.read_bytes(io_sp, &val, 4)) {
130 uint32_t dwarf_reg =
static_cast<uint32_t
>(dwarf::arm32::r4) +
static_cast<uint32_t
>(i);
131 if (!reg_ctx.write(dwarf_reg, val))
138 if (space.read_bytes(io_sp, &val, 4)) {
139 if (!reg_ctx.write(
static_cast<uint32_t
>(dwarf::arm32::r14), val))
146 else if ((opcode & 0xF8) == 0xB8) {
147 uint8_t count = opcode & 0x07;
148 for (
int i = 0; i <= count; ++i, io_sp += 8) {
150 if (space.read_bytes(io_sp, &val, 8)) {
151 uint32_t dwarf_reg =
static_cast<uint32_t
>(dwarf::arm32::d0) + 8U +
static_cast<uint32_t
>(i);
152 if (!reg_ctx.write_raw(dwarf_reg, &val, 8))
static RELOCO_UNSAFE_BUFFER_USAGE bool execute_bytecode(address_space_ref space, uint32_t unwind_word, uintptr_t &io_sp, uintptr_t &, register_context_ref reg_ctx) noexcept
Executes up to 3 inline unwind bytes from an exidx/extab word.
Definition arm_exidx_decoder.hpp:34
Zero-allocation, type-erased handle for inspecting and modifying CPU registers from a frame context.
Definition register_context.hpp:118