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

Forward-only cursor iterating over a stack walk backed by register context. More...

#include <frame_pointer.hpp>

Public Member Functions

constexpr frame_pointer_iterator () noexcept=default
 
constexpr frame_pointer_iterator (frame_unwinder_ref unwinder, register_context_ref reg_ctx, uintptr_t initial_fp, uintptr_t initial_pc) noexcept
 Constructs an iterator rooted at the given frame and register context.
 
constexpr const stack_frame & operator* () const noexcept RELOCO_LIFETIMEBOUND
 
constexpr const stack_frame * operator-> () const noexcept RELOCO_LIFETIMEBOUND
 
constexpr bool has_value () const noexcept
 
constexpr operator bool () const noexcept
 
bool next () noexcept
 Steps to the next (caller) frame using the unwinder and register context.
 
frame_pointer_iterator & operator++ () noexcept
 
template<typename Visitor >
void for_each_frame (Visitor &&visitor, uint32_t max_depth=64) noexcept
 

Detailed Description

Forward-only cursor iterating over a stack walk backed by register context.

Constructor & Destructor Documentation

◆ frame_pointer_iterator() [1/2]

constexpr microfmt::frame_pointer_iterator::frame_pointer_iterator ( )
constexprdefaultnoexcept

◆ frame_pointer_iterator() [2/2]

constexpr microfmt::frame_pointer_iterator::frame_pointer_iterator ( frame_unwinder_ref  unwinder,
register_context_ref  reg_ctx,
uintptr_t  initial_fp,
uintptr_t  initial_pc 
)
inlineconstexprnoexcept

Constructs an iterator rooted at the given frame and register context.

initial_pc is tracked internally and fed back into the unwinder's step() on every call, purely to let the backend look up the unwind descriptor covering the current frame (.ARM.exidx entry, DWARF FDE, unwind hint, ...). Callers do not need to pre-seed any register (e.g. the link register) with the crash/current PC before iterating; reg_ctx only needs to reflect the real register values of the frame being unwound.

Member Function Documentation

◆ for_each_frame()

template<typename Visitor >
void microfmt::frame_pointer_iterator::for_each_frame ( Visitor &&  visitor,
uint32_t  max_depth = 64 
)
inlinenoexcept

◆ has_value()

constexpr bool microfmt::frame_pointer_iterator::has_value ( ) const
inlineconstexprnoexcept

◆ next()

bool microfmt::frame_pointer_iterator::next ( )
inlinenoexcept

Steps to the next (caller) frame using the unwinder and register context.

◆ operator bool()

constexpr microfmt::frame_pointer_iterator::operator bool ( ) const
inlineexplicitconstexprnoexcept

◆ operator*()

constexpr const stack_frame & microfmt::frame_pointer_iterator::operator* ( ) const
inlineconstexprnoexcept

◆ operator++()

frame_pointer_iterator & microfmt::frame_pointer_iterator::operator++ ( )
inlinenoexcept

◆ operator->()

constexpr const stack_frame * microfmt::frame_pointer_iterator::operator-> ( ) const
inlineconstexprnoexcept

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