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

Forward-only cursor combining frame-pointer stepping with exception/trap transitions. More...

#include <hybrid_unwinder.hpp>

Public Member Functions

constexpr hybrid_stack_unwinder (frame_unwinder_ref fp_unwinder, exception_frame_ref trap_decoder, exception_matcher_ref matcher, register_context_ref reg_ctx, uintptr_t initial_fp, uintptr_t initial_pc) noexcept
 Constructs a hybrid unwinder.
 
constexpr const hybrid_frame & operator* () const noexcept
 Returns the current frame record.
 
constexpr const hybrid_frame * operator-> () const noexcept
 Returns the current frame record.
 
constexpr bool has_value () const noexcept
 Reports whether the cursor is positioned on a frame.
 
constexpr operator bool () const noexcept
 Reports whether the cursor is positioned on a frame.
 
bool next () noexcept
 Advances to the next frame.
 
hybrid_stack_unwinder & operator++ () noexcept
 Pre-increment advancing to the next frame.
 
template<typename Visitor >
void for_each_frame (Visitor &&visitor, uint32_t max_depth=64) noexcept
 Visitor-style traversal over the hybrid frame chain.
 

Detailed Description

Forward-only cursor combining frame-pointer stepping with exception/trap transitions.

Constructor & Destructor Documentation

◆ hybrid_stack_unwinder()

constexpr microfmt::hybrid_stack_unwinder::hybrid_stack_unwinder ( frame_unwinder_ref  fp_unwinder,
exception_frame_ref  trap_decoder,
exception_matcher_ref  matcher,
register_context_ref  reg_ctx,
uintptr_t  initial_fp,
uintptr_t  initial_pc 
)
inlineconstexprnoexcept

Constructs a hybrid unwinder.

Parameters
fp_unwinderFrame-pointer unwinder for standard frames.
trap_decoderTrap-frame decoder for transition frames.
matcherException trampoline detector.
reg_ctxTarget register context.
initial_fpFrame pointer of the starting frame.
initial_pcProgram counter of the starting frame.

Member Function Documentation

◆ for_each_frame()

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

Visitor-style traversal over the hybrid frame chain.

Template Parameters
VisitorCallable accepting const hybrid_frame & and returning bool (true = continue).
Parameters
visitorVisitor invoked per frame.
max_depthMaximum number of frames to visit.

◆ has_value()

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

Reports whether the cursor is positioned on a frame.

Returns
true while the current frame is valid.

◆ next()

bool microfmt::hybrid_stack_unwinder::next ( )
inlinenoexcept

Advances to the next frame.

Synthesizes a trap-transition frame when the current (fp, pc) matches an exception trampoline; otherwise performs a standard frame-pointer step.

Returns
false when the walk can advance no further.

◆ operator bool()

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

Reports whether the cursor is positioned on a frame.

Returns
true while the current frame is valid.

◆ operator*()

constexpr const hybrid_frame & microfmt::hybrid_stack_unwinder::operator* ( ) const
inlineconstexprnoexcept

Returns the current frame record.

Returns
Reference to the current hybrid_frame.

◆ operator++()

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

Pre-increment advancing to the next frame.

Returns
This unwinder.

◆ operator->()

constexpr const hybrid_frame * microfmt::hybrid_stack_unwinder::operator-> ( ) const
inlineconstexprnoexcept

Returns the current frame record.

Returns
Pointer to the current hybrid_frame.

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