microfmt
Zero-allocation C++ formatting for constrained environments
Loading...
Searching...
No Matches
Public Member Functions | List of all members
microfmt::extab_byte_stream Class Reference

Byte cursor pulling opcodes sequentially across .ARM.extab words. More...

#include <arm_extab_stream.hpp>

Public Member Functions

constexpr extab_byte_stream (address_space_ref space, uintptr_t extab_addr) noexcept
 Constructs a stream rooted at the first extab word.
 
constexpr bool failed () const noexcept
 Reports whether the stream failed to parse a supported word-0 header (e.g. an out-of-line personality-routine pointer, which cannot be interpreted as bytecode).
 
bool next_byte (uint8_t &out_byte) noexcept
 Pulls the next bytecode instruction byte across word boundaries.
 

Detailed Description

Byte cursor pulling opcodes sequentially across .ARM.extab words.

Per ARM EHABI ("Personality routine exception-handling table entries"), word 0's most-significant byte packs 1 <personality-index(3 bits)> <reserved(4 bits)>-like fields: bit 31 set marks an inline (rather than out-of-line personality-routine-pointer) table entry, and bits 27:24 select one of the three ABI personality routines, which in turn determines how many opcode bytes word 0 contributes and whether a word count follows:

Constructor & Destructor Documentation

◆ extab_byte_stream()

constexpr microfmt::extab_byte_stream::extab_byte_stream ( address_space_ref  space,
uintptr_t  extab_addr 
)
inlineconstexprnoexcept

Constructs a stream rooted at the first extab word.

Parameters
spaceAddress space to read from.
extab_addrAddress of the .ARM.extab entry.

Member Function Documentation

◆ failed()

constexpr bool microfmt::extab_byte_stream::failed ( ) const
inlineconstexprnoexcept

Reports whether the stream failed to parse a supported word-0 header (e.g. an out-of-line personality-routine pointer, which cannot be interpreted as bytecode).

◆ next_byte()

bool microfmt::extab_byte_stream::next_byte ( uint8_t &  out_byte)
inlinenoexcept

Pulls the next bytecode instruction byte across word boundaries.

Parameters
out_byteReceives the next opcode byte.
Returns
true when a byte was produced, false at end of stream or on a read failure.

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