1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +00:00

better debug output in segfaults and stack overflows in windows

This commit is contained in:
Perttu Ahola 2010-12-27 14:34:17 +02:00
parent 847a4227b8
commit fa64103aa8
9 changed files with 138 additions and 90 deletions

View file

@ -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