28 std::string
print_assert(
const char* file,
const char* func,
int line,
const char* description) {
29 std::stringstream str;
30 str <<
"***************************************************************************" << std::endl;
31 str <<
"**** Assertion failed! \"" << description
32 <<
"\" did not hold in " << func <<
"(): " << file <<
":" << line << std::endl;
33 str <<
"***************************************************************************" << std::endl;
39 std::stringstream str;
40 str <<
"=== Stack frame (length=" << traces.size() <<
")" << std::endl;
41 for (uint16_t i = 0; i < traces.size(); ++i) {
42 str <<
"- [" << i <<
"/" << traces.size() <<
"] " << traces[i] << std::endl;
53 std::string message =
print_assert(file, func, line, description);
55 static_recent_assert_backtrace += message;
std::string get_recent_assert_backtrace()
Retrieves the info left by print_assert_backtrace().
std::string print_assert(const char *file, const char *func, int line, const char *description)
Helper function to report what assertion failed.
Root package of FOEDUS (Fast Optimistic Engine for Data Unification Services).
std::vector< std::string > get_backtrace(bool rich=true)
Returns the backtrace information of the current stack.
void print_assert_backtrace(const char *file, const char *func, int line, const char *description)
print_assert() + print_backtrace().
std::string static_recent_assert_backtrace
Leaves recent crash information in a static global variable so that a signal handler can pick it...
std::string print_backtrace()
Prints out backtrace.