mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-14 19:15:05 -05:00
fix windows crashlog
This commit is contained in:
parent
47e7f8308a
commit
0602b34734
1 changed files with 6 additions and 10 deletions
|
@ -339,11 +339,15 @@ static std::string getInfo(LPEXCEPTION_POINTERS info, Mod* faultyMod) {
|
|||
|
||||
// show the thread that crashed
|
||||
stream << "Crashed thread: " << utils::thread::getName() << "\n";
|
||||
|
||||
|
||||
return stream.str();
|
||||
}
|
||||
|
||||
static LONG WINAPI exceptionHandler(LPEXCEPTION_POINTERS info) {
|
||||
// not all exceptions are critical, some (i.e. SetThreadName) can and should be ignored
|
||||
if (info->ExceptionRecord->ExceptionCode == 0x406d1388) {
|
||||
return EXCEPTION_CONTINUE_EXECUTION;
|
||||
}
|
||||
|
||||
SymSetOptions(SYMOPT_UNDNAME | SYMOPT_DEFERRED_LOADS | SYMOPT_LOAD_LINES);
|
||||
|
||||
|
@ -359,16 +363,8 @@ static LONG WINAPI exceptionHandler(LPEXCEPTION_POINTERS info) {
|
|||
return EXCEPTION_CONTINUE_SEARCH;
|
||||
}
|
||||
|
||||
static LONG WINAPI exceptionHandlerDummy(LPEXCEPTION_POINTERS info) {
|
||||
SetUnhandledExceptionFilter(exceptionHandler);
|
||||
return EXCEPTION_CONTINUE_SEARCH;
|
||||
}
|
||||
|
||||
bool crashlog::setupPlatformHandler() {
|
||||
// for some reason, on exceptions windows seems to clear SetUnhandledExceptionFilter
|
||||
// so we attach a VE handler (which runs *earlier*) and inside set our crash handler
|
||||
AddVectoredExceptionHandler(0, exceptionHandlerDummy);
|
||||
SetUnhandledExceptionFilter(exceptionHandler);
|
||||
AddVectoredExceptionHandler(1, exceptionHandler);
|
||||
|
||||
auto lastCrashedFile = crashlog::getCrashLogDirectory() / "last-crashed";
|
||||
if (std::filesystem::exists(lastCrashedFile)) {
|
||||
|
|
Loading…
Reference in a new issue