aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/logging/crashhandler.cpp
diff options
context:
space:
mode:
authorGeckoEidechse <gecko.eidechse+git@pm.me>2023-09-17 01:45:16 +0200
committerGeckoEidechse <gecko.eidechse+git@pm.me>2023-09-17 01:45:16 +0200
commit5cbe9f7317899cd815b38d9f083bc99738fc1dd3 (patch)
tree9afdce5ae5e76f68be85c25a84afcff86f31d3f8 /NorthstarDLL/logging/crashhandler.cpp
parentb7823492e802456d44e4919940267081bf436f08 (diff)
downloadNorthstarLauncher-5cbe9f7317899cd815b38d9f083bc99738fc1dd3.tar.gz
NorthstarLauncher-5cbe9f7317899cd815b38d9f083bc99738fc1dd3.zip
test ci format checkindentation-test
Diffstat (limited to 'NorthstarDLL/logging/crashhandler.cpp')
-rw-r--r--NorthstarDLL/logging/crashhandler.cpp66
1 files changed, 33 insertions, 33 deletions
diff --git a/NorthstarDLL/logging/crashhandler.cpp b/NorthstarDLL/logging/crashhandler.cpp
index 5d120d1f..6cc0f5d3 100644
--- a/NorthstarDLL/logging/crashhandler.cpp
+++ b/NorthstarDLL/logging/crashhandler.cpp
@@ -13,16 +13,16 @@ std::shared_ptr<ExceptionLog> storedException {};
#define RUNTIME_EXCEPTION 3765269347
// clang format did this :/
std::map<int, std::string> ExceptionNames = {
- {EXCEPTION_ACCESS_VIOLATION, "Access Violation"}, {EXCEPTION_IN_PAGE_ERROR, "Access Violation"},
- {EXCEPTION_ARRAY_BOUNDS_EXCEEDED, "Array bounds exceeded"}, {EXCEPTION_DATATYPE_MISALIGNMENT, "Datatype misalignment"},
- {EXCEPTION_FLT_DENORMAL_OPERAND, "Denormal operand"}, {EXCEPTION_FLT_DIVIDE_BY_ZERO, "Divide by zero (float)"},
- {EXCEPTION_FLT_INEXACT_RESULT, "Inexact float result"}, {EXCEPTION_FLT_INVALID_OPERATION, "Invalid operation"},
- {EXCEPTION_FLT_OVERFLOW, "Numeric overflow (float)"}, {EXCEPTION_FLT_STACK_CHECK, "Stack check"},
- {EXCEPTION_FLT_UNDERFLOW, "Numeric underflow (float)"}, {EXCEPTION_ILLEGAL_INSTRUCTION, "Illegal instruction"},
- {EXCEPTION_INT_DIVIDE_BY_ZERO, "Divide by zero (int)"}, {EXCEPTION_INT_OVERFLOW, "Numeric overfloat (int)"},
- {EXCEPTION_INVALID_DISPOSITION, "Invalid disposition"}, {EXCEPTION_NONCONTINUABLE_EXCEPTION, "Non-continuable exception"},
- {EXCEPTION_PRIV_INSTRUCTION, "Priviledged instruction"}, {EXCEPTION_STACK_OVERFLOW, "Stack overflow"},
- {RUNTIME_EXCEPTION, "Uncaught runtime exception:"},
+ {EXCEPTION_ACCESS_VIOLATION, "Access Violation"}, {EXCEPTION_IN_PAGE_ERROR, "Access Violation"},
+ {EXCEPTION_ARRAY_BOUNDS_EXCEEDED, "Array bounds exceeded"}, {EXCEPTION_DATATYPE_MISALIGNMENT, "Datatype misalignment"},
+ {EXCEPTION_FLT_DENORMAL_OPERAND, "Denormal operand"}, {EXCEPTION_FLT_DIVIDE_BY_ZERO, "Divide by zero (float)"},
+ {EXCEPTION_FLT_INEXACT_RESULT, "Inexact float result"}, {EXCEPTION_FLT_INVALID_OPERATION, "Invalid operation"},
+ {EXCEPTION_FLT_OVERFLOW, "Numeric overflow (float)"}, {EXCEPTION_FLT_STACK_CHECK, "Stack check"},
+ {EXCEPTION_FLT_UNDERFLOW, "Numeric underflow (float)"}, {EXCEPTION_ILLEGAL_INSTRUCTION, "Illegal instruction"},
+ {EXCEPTION_INT_DIVIDE_BY_ZERO, "Divide by zero (int)"}, {EXCEPTION_INT_OVERFLOW, "Numeric overfloat (int)"},
+ {EXCEPTION_INVALID_DISPOSITION, "Invalid disposition"}, {EXCEPTION_NONCONTINUABLE_EXCEPTION, "Non-continuable exception"},
+ {EXCEPTION_PRIV_INSTRUCTION, "Priviledged instruction"}, {EXCEPTION_STACK_OVERFLOW, "Stack overflow"},
+ {RUNTIME_EXCEPTION, "Uncaught runtime exception:"},
};
void PrintExceptionLog(ExceptionLog& exc)
@@ -67,10 +67,10 @@ void PrintExceptionLog(ExceptionLog& exc)
if (!IsDedicatedServer())
MessageBoxA(
- 0,
- "Northstar has crashed! Crash info can be found in R2Northstar/logs",
- "Northstar has crashed!",
- MB_ICONERROR | MB_OK | MB_SYSTEMMODAL);
+ 0,
+ "Northstar has crashed! Crash info can be found in R2Northstar/logs",
+ "Northstar has crashed!",
+ MB_ICONERROR | MB_OK | MB_SYSTEMMODAL);
NS::log::FlushLoggers();
}
@@ -111,16 +111,16 @@ template <> struct fmt::formatter<M128A> : fmt::formatter<string_view>
int v3 = obj.High & INT_MAX;
int v4 = obj.High >> 32;
return fmt::format_to(
- ctx.out(),
- "[ {:G}, {:G}, {:G}, {:G}], [ 0x{:x}, 0x{:x}, 0x{:x}, 0x{:x} ]",
- *reinterpret_cast<float*>(&v1),
- *reinterpret_cast<float*>(&v2),
- *reinterpret_cast<float*>(&v3),
- *reinterpret_cast<float*>(&v4),
- v1,
- v2,
- v3,
- v4);
+ ctx.out(),
+ "[ {:G}, {:G}, {:G}, {:G}], [ 0x{:x}, 0x{:x}, 0x{:x}, 0x{:x} ]",
+ *reinterpret_cast<float*>(&v1),
+ *reinterpret_cast<float*>(&v2),
+ *reinterpret_cast<float*>(&v3),
+ *reinterpret_cast<float*>(&v4),
+ v1,
+ v2,
+ v3,
+ v4);
}
};
@@ -153,7 +153,7 @@ void GenerateTrace(ExceptionLog& exc, bool skipErrorHandlingFrames = true, int n
if (!haveSkippedErrorHandlingFrames)
{
if (!strncmp(backtraceModuleFullName, crashedModuleFullName, MAX_PATH) &&
- !strncmp(backtraceModuleName, crashedModuleName, MAX_PATH))
+ !strncmp(backtraceModuleName, crashedModuleName, MAX_PATH))
{
haveSkippedErrorHandlingFrames = true;
}
@@ -248,13 +248,13 @@ void CreateMiniDump(EXCEPTION_POINTERS* exceptionInfo)
dumpExceptionInfo.ClientPointers = false;
MiniDumpWriteDump(
- GetCurrentProcess(),
- GetCurrentProcessId(),
- hMinidumpFile,
- MINIDUMP_TYPE(MiniDumpWithIndirectlyReferencedMemory | MiniDumpScanMemory),
- &dumpExceptionInfo,
- nullptr,
- nullptr);
+ GetCurrentProcess(),
+ GetCurrentProcessId(),
+ hMinidumpFile,
+ MINIDUMP_TYPE(MiniDumpWithIndirectlyReferencedMemory | MiniDumpScanMemory),
+ &dumpExceptionInfo,
+ nullptr,
+ nullptr);
CloseHandle(hMinidumpFile);
}
else
@@ -344,7 +344,7 @@ void RuntimeExceptionHandler()
else
{
spdlog::error(
- "std::current_exception() returned nullptr while being handled by RuntimeExceptionHandler. This should never happen!");
+ "std::current_exception() returned nullptr while being handled by RuntimeExceptionHandler. This should never happen!");
std::abort();
}
}