From fa64103aa87a8f0f2a3351bb4a54e93e8ade1082 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Mon, 27 Dec 2010 14:34:17 +0200 Subject: better debug output in segfaults and stack overflows in windows --- src/debug.h | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) (limited to 'src/debug.h') diff --git a/src/debug.h b/src/debug.h index 3f269176a..8faa65eb8 100644 --- a/src/debug.h +++ b/src/debug.h @@ -27,6 +27,15 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "common_irrlicht.h" #include "threads.h" #include "gettime.h" +#include "constants.h" +#include "exceptions.h" + +#ifdef _WIN32 + #define WIN32_LEAN_AND_MEAN + #include + #include +#else +#endif /* Debug output @@ -215,6 +224,60 @@ private: core::map m_packets; }; +/* + These should be put into every thread +*/ + +#if CATCH_UNHANDLED_EXCEPTIONS == 1 + #define BEGIN_PORTABLE_DEBUG_EXCEPTION_HANDLER try{ + #define END_PORTABLE_DEBUG_EXCEPTION_HANDLER\ + }catch(std::exception &e){\ + dstream<