From 201313a9f84192ad7f2fcd7e4ab2cc793a85b96f Mon Sep 17 00:00:00 2001 From: Mattes D Date: Sat, 29 Nov 2014 23:06:10 +0100 Subject: Added a basic stacktracing for assert and signal failures. --- src/Globals.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/Globals.h') diff --git a/src/Globals.h b/src/Globals.h index 582f5fdaa..d75ae0093 100644 --- a/src/Globals.h +++ b/src/Globals.h @@ -264,6 +264,7 @@ template class SizeChecker; #include "OSSupport/Thread.h" #include "OSSupport/File.h" #include "Logger.h" + #include "OSSupport/StackTrace.h" #else // Logging functions void inline LOGERROR(const char* a_Format, ...) FORMATSTRING(1, 2); @@ -349,14 +350,14 @@ void inline LOGD(const char* a_Format, ...) #else #ifdef _DEBUG - #define ASSERT( x) ( !!(x) || ( LOGERROR("Assertion failed: %s, file %s, line %i", #x, __FILE__, __LINE__), assert(0), 0)) + #define ASSERT( x) ( !!(x) || ( LOGERROR("Assertion failed: %s, file %s, line %i", #x, __FILE__, __LINE__), PrintStackTrace(), assert(0), 0)) #else #define ASSERT(x) ((void)(x)) #endif #endif // Pretty much the same as ASSERT() but stays in Release builds -#define VERIFY( x) ( !!(x) || ( LOGERROR("Verification failed: %s, file %s, line %i", #x, __FILE__, __LINE__), exit(1), 0)) +#define VERIFY( x) ( !!(x) || ( LOGERROR("Verification failed: %s, file %s, line %i", #x, __FILE__, __LINE__), PrintStackTrace(), exit(1), 0)) // Same as assert but in all Self test builds #ifdef SELF_TEST -- cgit v1.2.3