diff options
author | Perttu Ahola <celeron55@gmail.com> | 2010-12-27 14:34:17 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2010-12-27 14:34:17 +0200 |
commit | fa64103aa87a8f0f2a3351bb4a54e93e8ade1082 (patch) | |
tree | 689986c383e3444cba35a16864e03f61593c5686 /src/server.cpp | |
parent | 847a4227b850bc943d11c5b8191fb6bcbce1920a (diff) | |
download | minetest-fa64103aa87a8f0f2a3351bb4a54e93e8ade1082.tar.gz minetest-fa64103aa87a8f0f2a3351bb4a54e93e8ade1082.tar.bz2 minetest-fa64103aa87a8f0f2a3351bb4a54e93e8ade1082.zip |
better debug output in segfaults and stack overflows in windows
Diffstat (limited to 'src/server.cpp')
-rw-r--r-- | src/server.cpp | 34 |
1 files changed, 7 insertions, 27 deletions
diff --git a/src/server.cpp b/src/server.cpp index cbe2b932f..05ef13d93 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -40,6 +40,8 @@ void * ServerThread::Thread() DSTACK(__FUNCTION_NAME); + BEGIN_DEBUG_EXCEPTION_HANDLER + while(getRun()) { try{ @@ -51,19 +53,9 @@ void * ServerThread::Thread() catch(con::NoIncomingDataException &e) { } -#if CATCH_UNHANDLED_EXCEPTIONS - /* - This is what has to be done in threads to get suitable debug info - */ - catch(std::exception &e) - { - dstream<<std::endl<<DTIME<<"An unhandled exception occurred: " - <<e.what()<<std::endl; - assert(0); - } -#endif } + END_DEBUG_EXCEPTION_HANDLER return NULL; } @@ -75,11 +67,9 @@ void * EmergeThread::Thread() DSTACK(__FUNCTION_NAME); bool debug=false; -#if CATCH_UNHANDLED_EXCEPTIONS - try - { -#endif + BEGIN_DEBUG_EXCEPTION_HANDLER + /* Get block info from queue, emerge them and send them to clients. @@ -267,18 +257,8 @@ void * EmergeThread::Thread() } } -#if CATCH_UNHANDLED_EXCEPTIONS - }//try - /* - This is what has to be done in threads to get suitable debug info - */ - catch(std::exception &e) - { - dstream<<std::endl<<DTIME<<"An unhandled exception occurred: " - <<e.what()<<std::endl; - assert(0); - } -#endif + + END_DEBUG_EXCEPTION_HANDLER return NULL; } |