mirror of
https://github.com/vcmi/vcmi.git
synced 2025-10-08 23:22:25 +02:00
Enabled terminate handler and call stack writing on all platforms
Attempt to get a bit more debug info from crashes. VCMI will now: - use c++ terminate handler on any platform in release builds - attempt to write call stack to log file using boost::callstack Since I use std::set_terminate this will only affect c++ exceptions, e.g. std::runtime_error and will not affect OS signals, e.g. SIGSEGV. Handling signals is OS-specific and has a lot of limitations that I don't want to investigate. Besides - most of our crashes are now caused by c++ exceptions. Haven't tested on other platforms, but should at the very least write exception information (`e.what()`) for all exceptions and function names for methods exported from dll's (libvcmi.so & AI's). Possibly more, if debug information is present.
This commit is contained in:
6
Global.h
6
Global.h
@@ -102,6 +102,12 @@ static_assert(sizeof(bool) == 1, "Bool needs to be 1 byte in size.");
|
||||
# define STRONG_INLINE inline
|
||||
#endif
|
||||
|
||||
// Required for building boost::stacktrace on macOS.
|
||||
// See https://github.com/boostorg/stacktrace/issues/88
|
||||
#if defined(VCMI_APPLE)
|
||||
#define _GNU_SOURCE
|
||||
#endif
|
||||
|
||||
#define _USE_MATH_DEFINES
|
||||
|
||||
#include <algorithm>
|
||||
|
Reference in New Issue
Block a user