MCPcopy Create free account
hub / github.com/boostorg/stacktrace / current_exception_stacktrace

Function current_exception_stacktrace

src/from_exception.cpp:340–365  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

338namespace boost { namespace stacktrace { namespace impl {
339
340BOOST_SYMBOL_EXPORT const char* current_exception_stacktrace() noexcept {
341 if (!ref_capture_stacktraces_at_throw()) {
342 return nullptr;
343 }
344
345 auto exc_ptr = std::current_exception();
346 void* const exc_raw_ptr = get_current_exception_raw_ptr(&exc_ptr);
347 if (!exc_raw_ptr) {
348 return nullptr;
349 }
350
351#if !BOOST_STACKTRACE_ALWAYS_STORE_IN_PADDING
352 if (__cxxabiv1::is_libcpp_runtime()) {
353 const std::lock_guard<std::mutex> guard{g_mapping_mutex};
354 const auto it = g_exception_to_dump_mapping.find(exc_raw_ptr);
355 if (it != g_exception_to_dump_mapping.end()) {
356 return it->second;
357 } else {
358 return nullptr;
359 }
360 } else
361#endif
362 {
363 return __cxxabiv1::reference_to_empty_padding(exc_raw_ptr);
364 }
365}
366
367BOOST_SYMBOL_EXPORT void assert_no_pending_traces() noexcept {
368#if !BOOST_STACKTRACE_ALWAYS_STORE_IN_PADDING

Callers 1

from_current_exceptionFunction · 0.85

Calls 2

is_libcpp_runtimeFunction · 0.85

Tested by

no test coverage detected