9#ifdef ASE_WITH_CPPTRACE
10#include <cpptrace/from_current.hpp>
15VirtualBase::~VirtualBase() noexcept
27 const char *mangled_identifier = typeinfo.name();
29 auto it = m2d.find (mangled_identifier);
34 char *malloced_result = abi::__cxa_demangle (mangled_identifier, NULL, NULL, &status);
35 if (malloced_result && !status) {
37 auto it = m2d.find (mangled_identifier);
38 if (it != m2d.end()) {
39 free (malloced_result);
42 m2d[mangled_identifier] = malloced_result;
43 return malloced_result;
45 return mangled_identifier;
52 char *malloced_result = abi::__cxa_demangle (mangled_identifier, NULL, NULL, &status);
54 if (malloced_result && !status) {
55 result = malloced_result;
56 free (malloced_result);
58 return result.
empty() ? mangled_identifier : result;
74assertion_fatal (
const char *msg,
const char *file,
int line,
const char *func)
noexcept
76 logging_abort (ASSERTION, msg ? msg :
"", file, line, func);
81assertion_failed (
const char *msg,
const char *file,
int line,
const char *func)
noexcept
83 return logging (ASSERTION, msg ? msg :
"", file, line, func);
89#ifdef ASE_WITH_CPPTRACE
90 cpptrace::rethrow (exception);
The Anklang C++ API namespace.
void assertion_failed(const char *msg, const char *file, int line, const char *func) noexcept
Print instructive message, handle "breakpoint", "backtrace" and "fatal-warnings" in $ASE_DEBUG.
const char * cxx_demangle(const std::type_info &typeinfo) noexcept
Demangle a std::typeinfo.name() string into a proper C++ type name.
void assertion_fatal(const char *msg, const char *file, int line, const char *func) noexcept
Print a debug message via assertion_failed() and abort the program.
void perror_die(const std::string &msg) noexcept
Issue a warning about an assertion error.
void ase_rethrow(std::exception_ptr exception)
Helper to trace rethrown exceptions.
T rethrow_exception(T... args)