From dea7d429abe5143672154784f93e4b19020062d5 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 3 Mar 2016 17:29:48 +0100 Subject: Core/Debugging: Make abort() less bad on windows by forcing crash log generation --- src/common/Debugging/Errors.cpp | 7 +++++++ src/common/Debugging/Errors.h | 2 ++ 2 files changed, 9 insertions(+) (limited to 'src/common/Debugging') diff --git a/src/common/Debugging/Errors.cpp b/src/common/Debugging/Errors.cpp index 04624147e1b..789249ee310 100644 --- a/src/common/Debugging/Errors.cpp +++ b/src/common/Debugging/Errors.cpp @@ -96,4 +96,11 @@ void Abort(char const* file, int line, char const* function) exit(1); } +void AbortHandler(int sigval) +{ + // nothing useful to log here, no way to pass args + *((volatile int*)NULL) = 0; + exit(1); +} + } // namespace Trinity diff --git a/src/common/Debugging/Errors.h b/src/common/Debugging/Errors.h index 38e311a6b13..37d247ada82 100644 --- a/src/common/Debugging/Errors.h +++ b/src/common/Debugging/Errors.h @@ -34,6 +34,8 @@ namespace Trinity void Warning(char const* file, int line, char const* function, char const* message); + DECLSPEC_NORETURN void AbortHandler(int sigval) ATTR_NORETURN; + } // namespace Trinity #if COMPILER == COMPILER_MICROSOFT -- cgit v1.2.3