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

Type-erased hook detecting exception trampolines during unwinding. More...

#include <hybrid_unwinder.hpp>

Classes

struct  vtable
 Virtual table of matcher operations. More...
 

Public Member Functions

constexpr exception_matcher_ref () noexcept=default
 Constructs an empty (invalid) matcher.
 
template<typename Tag , typename Context , typename Traits = exception_matcher_traits<Tag>, std::enable_if_t< std::is_convertible_v< const Context *, const typename Traits::context_type * >, int > = 0>
constexpr exception_matcher_ref (Tag, const Context &ctx RELOCO_LIFETIMEBOUND RELOCO_LIFETIME_CAPTURE_BY_THIS) noexcept
 Constructs a matcher bound to a traits context.
 
template<typename Tag , typename Context , std::enable_if_t<!std::is_lvalue_reference_v< Context >, int > = 0>
constexpr exception_matcher_ref (Tag, Context &&)=delete
 
bool match_trap_frame (uintptr_t fp, uintptr_t pc, uintptr_t &out_trap_frame_addr) const noexcept
 Tests whether (fp, pc) is an exception trampoline.
 
constexpr operator bool () const noexcept
 Reports whether the matcher is bound.
 

Static Public Member Functions

template<typename Tag , typename Context , typename Traits = exception_matcher_traits<Tag>>
static constexpr exception_matcher_ref make (const Context &ctx RELOCO_LIFETIMEBOUND) noexcept
 
template<typename Tag , typename Context , std::enable_if_t<!std::is_lvalue_reference_v< Context >, int > = 0>
static exception_matcher_ref make (Context &&)=delete
 

Detailed Description

Type-erased hook detecting exception trampolines during unwinding.

Constructor & Destructor Documentation

◆ exception_matcher_ref() [1/3]

constexpr microfmt::exception_matcher_ref::exception_matcher_ref ( )
constexprdefaultnoexcept

Constructs an empty (invalid) matcher.

◆ exception_matcher_ref() [2/3]

template<typename Tag , typename Context , typename Traits = exception_matcher_traits<Tag>, std::enable_if_t< std::is_convertible_v< const Context *, const typename Traits::context_type * >, int > = 0>
constexpr microfmt::exception_matcher_ref::exception_matcher_ref ( Tag  ,
const Context &ctx RELOCO_LIFETIMEBOUND  RELOCO_LIFETIME_CAPTURE_BY_THIS 
)
inlineconstexprnoexcept

Constructs a matcher bound to a traits context.

Template Parameters
TagMatcher implementation tag.
ContextConcrete context convertible to the trait context type.
Parameters
ctxContext object performing the match.

◆ exception_matcher_ref() [3/3]

template<typename Tag , typename Context , std::enable_if_t<!std::is_lvalue_reference_v< Context >, int > = 0>
constexpr microfmt::exception_matcher_ref::exception_matcher_ref ( Tag  ,
Context &&   
)
constexprdelete

Member Function Documentation

◆ make() [1/2]

template<typename Tag , typename Context , typename Traits = exception_matcher_traits<Tag>>
static constexpr exception_matcher_ref microfmt::exception_matcher_ref::make ( const Context &ctx  RELOCO_LIFETIMEBOUND)
inlinestaticconstexprnoexcept

◆ make() [2/2]

template<typename Tag , typename Context , std::enable_if_t<!std::is_lvalue_reference_v< Context >, int > = 0>
static exception_matcher_ref microfmt::exception_matcher_ref::make ( Context &&  )
staticdelete

◆ match_trap_frame()

bool microfmt::exception_matcher_ref::match_trap_frame ( uintptr_t  fp,
uintptr_t  pc,
uintptr_t &  out_trap_frame_addr 
) const
inlinenoexcept

Tests whether (fp, pc) is an exception trampoline.

Parameters
fpCurrent frame pointer.
pcCurrent program counter.
out_trap_frame_addrReceives the trap frame address.
Returns
true when matched.

◆ operator bool()

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

Reports whether the matcher is bound.

Returns
true when the matcher is valid.

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