mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Debugging: Make abort() less bad on windows by forcing crash log generation
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -85,6 +85,8 @@ LoginDatabaseWorkerPool LoginDatabase;
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
std::signal(SIGABRT, &Trinity::AbortHandler);
|
||||
|
||||
std::string configFile = _TRINITY_BNET_CONFIG;
|
||||
std::string configService;
|
||||
auto vm = GetConsoleArguments(argc, argv, configFile, configService);
|
||||
|
||||
@@ -101,6 +101,8 @@ variables_map GetConsoleArguments(int argc, char** argv, std::string& cfg_file,
|
||||
/// Launch the Trinity server
|
||||
extern int main(int argc, char** argv)
|
||||
{
|
||||
std::signal(SIGABRT, &Trinity::AbortHandler);
|
||||
|
||||
std::string configFile = _TRINITY_CORE_CONFIG;
|
||||
std::string configService;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user