summaryrefslogtreecommitdiff
path: root/src/debug.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/debug.cpp')
-rw-r--r--src/debug.cpp30
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
+
+
+