proxygen
__cxxabiv1 Namespace Reference

Classes

struct  __cxa_eh_globals
 
struct  __cxa_exception
 

Functions

__cxa_eh_globals__cxa_get_globals (void) noexcept
 
__cxa_eh_globals__cxa_get_globals_fast (void) noexcept
 
void __cxa_throw (void *thrownException, std::type_info *type, void(*destructor)(void *)) __attribute__((__noreturn__))
 
void * __cxa_begin_catch (void *excObj) throw ()
 
void __cxa_rethrow (void) __attribute__((__noreturn__))
 
void __cxa_end_catch (void)
 

Function Documentation

void * __cxxabiv1::__cxa_begin_catch ( void *  excObj)
throw (
)

Definition at line 124 of file ExceptionTracerLib.cpp.

References folly::exception_tracer::getCxaBeginCatchCallbacks().

124  {
125  // excObj is a pointer to the unwindHeader in __cxa_exception
126  static auto orig_cxa_begin_catch =
127  reinterpret_cast<decltype(&__cxa_begin_catch)>(
128  dlsym(RTLD_NEXT, "__cxa_begin_catch"));
129  getCxaBeginCatchCallbacks().invoke(excObj);
130  return orig_cxa_begin_catch(excObj);
131 }
void * __cxa_begin_catch(void *excObj)
CallbackHolder< CxaBeginCatchType > & getCxaBeginCatchCallbacks()
void __cxxabiv1::__cxa_end_catch ( void  )

Definition at line 133 of file ExceptionTracerLib.cpp.

References folly::exception_tracer::getCxaEndCatchCallbacks().

133  {
134  static auto orig_cxa_end_catch = reinterpret_cast<decltype(&__cxa_end_catch)>(
135  dlsym(RTLD_NEXT, "__cxa_end_catch"));
136  getCxaEndCatchCallbacks().invoke();
137  orig_cxa_end_catch();
138 }
CallbackHolder< CxaEndCatchType > & getCxaEndCatchCallbacks()
void __cxa_end_catch(void)
__cxa_eh_globals* __cxxabiv1::__cxa_get_globals ( void  )
noexcept
__cxa_eh_globals* __cxxabiv1::__cxa_get_globals_fast ( void  )
noexcept
void __cxxabiv1::__cxa_rethrow ( void  )

Definition at line 111 of file ExceptionTracerLib.cpp.

References folly::exception_tracer::getCxaRethrowCallbacks().

111  {
112  // __cxa_rethrow leaves the current exception on the caught stack,
113  // and __cxa_begin_catch recognizes that case. We could do the same, but
114  // we'll implement something simpler (and slower): we pop the exception from
115  // the caught stack, and push it back onto the active stack; this way, our
116  // implementation of __cxa_begin_catch doesn't have to do anything special.
117  static auto orig_cxa_rethrow = reinterpret_cast<decltype(&__cxa_rethrow)>(
118  dlsym(RTLD_NEXT, "__cxa_rethrow"));
119  getCxaRethrowCallbacks().invoke();
120  orig_cxa_rethrow();
121  __builtin_unreachable(); // orig_cxa_rethrow never returns
122 }
void __cxa_rethrow(void) __attribute__((__noreturn__))
CallbackHolder< CxaRethrowType > & getCxaRethrowCallbacks()
void __cxxabiv1::__cxa_throw ( void *  thrownException,
std::type_info *  type,
void(*)(void *)  destructor 
)

Definition at line 100 of file ExceptionTracerLib.cpp.

References folly::exception_tracer::getCxaThrowCallbacks().

103  {
104  static auto orig_cxa_throw =
105  reinterpret_cast<decltype(&__cxa_throw)>(dlsym(RTLD_NEXT, "__cxa_throw"));
106  getCxaThrowCallbacks().invoke(thrownException, type, destructor);
107  orig_cxa_throw(thrownException, type, destructor);
108  __builtin_unreachable(); // orig_cxa_throw never returns
109 }
PskType type
CallbackHolder< CxaThrowType > & getCxaThrowCallbacks()
void __cxa_throw(void *thrownException, std::type_info *type, void(*destructor)(void *)) __attribute__((__noreturn__))