version 1.1.1.1, 2013/07/22 08:44:29
|
version 1.1.1.2, 2016/11/01 09:56:12
|
Line 13
|
Line 13
|
void |
void |
DoAssert(const char *file, int line, const char *failedexpr) |
DoAssert(const char *file, int line, const char *failedexpr) |
{ |
{ |
|
#ifdef USE_BACKTRACE |
|
void *buffer[100]; |
|
char **strings; |
|
int n, k; |
|
|
|
n = backtrace(buffer, 100); |
|
strings = backtrace_symbols(buffer, n); |
|
if (strings == NULL) { |
|
Log(LG_ERR, ("No backtrace symbols found")); |
|
} else { |
|
for (k = 0; k < n; k++) { |
|
Log(LG_ERR, ("%s", strings[k])); |
|
} |
|
free(strings); |
|
} |
|
#endif |
Log(LG_ERR, ("ASSERT \"%s\" failed: file \"%s\", line %d", |
Log(LG_ERR, ("ASSERT \"%s\" failed: file \"%s\", line %d", |
failedexpr, file, line)); |
failedexpr, file, line)); |
|
|
DoExit(EX_ERRDEAD); |
DoExit(EX_ERRDEAD); |
} |
} |
|
|