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/debug.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/debug.cpp')
-rw-r--r-- | src/debug.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/debug.cpp b/src/debug.cpp index df8cbeb22..9fbdf7a39 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -194,3 +194,33 @@ DebugStacker::~DebugStacker() } } + +#ifdef _WIN32 +void se_trans_func(unsigned int u, EXCEPTION_POINTERS* pExp) +{ + dstream<<"In trans_func.\n"; + if(u == EXCEPTION_ACCESS_VIOLATION) + { + PEXCEPTION_RECORD r = pExp->ExceptionRecord; + dstream<<"Access violation at "<<r->ExceptionAddress + <<" write?="<<r->ExceptionInformation[0] + <<" address="<<r->ExceptionInformation[1] + <<std::endl; + throw FatalSystemException + ("Access violation"); + } + if(u == EXCEPTION_STACK_OVERFLOW) + { + throw FatalSystemException + ("Stack overflow"); + } + if(u == EXCEPTION_ILLEGAL_INSTRUCTION) + { + throw FatalSystemException + ("Illegal instruction"); + } +} +#endif + + + |