Full crash report on windows.

This commit is contained in:
KimLS
2023-01-23 18:34:55 -08:00
parent 626fb932a7
commit fb1a0da9cb
+23 -6
View File
@@ -13,6 +13,7 @@
#include "platform.h"
#include <cstdio>
#include <vector>
#if WINDOWS
#define popen _popen
@@ -111,19 +112,22 @@ public:
if (szText[i] == '\n' || szText[i] == '\r') {
buffer[i] = ' ';
} else {
}
else {
buffer[i] = szText[i];
}
}
if (RuleB(Analytics, CrashReporting)) {
std::string crash_report = buffer;
SendCrashReport(crash_report);
}
std::string line = buffer;
_lines.push_back(line);
Log(Logs::General, Logs::Crash, buffer);
StackWalker::OnOutput(szText);
}
const std::vector<std::string>& const GetLines() { return _lines; }
private:
std::vector<std::string> _lines;
};
LONG WINAPI windows_exception_handler(EXCEPTION_POINTERS *ExceptionInfo)
@@ -197,7 +201,20 @@ LONG WINAPI windows_exception_handler(EXCEPTION_POINTERS *ExceptionInfo)
if(EXCEPTION_STACK_OVERFLOW != ExceptionInfo->ExceptionRecord->ExceptionCode)
{
EQEmuStackWalker sw; sw.ShowCallstack(GetCurrentThread(), ExceptionInfo->ContextRecord);
EQEmuStackWalker sw;
sw.ShowCallstack(GetCurrentThread(), ExceptionInfo->ContextRecord);
if (RuleB(Analytics, CrashReporting)) {
std::string crash_report;
auto& lines = sw.GetLines();
for (auto& line : lines) {
crash_report += line;
crash_report += "\n";
}
SendCrashReport(crash_report);
}
}
return EXCEPTION_EXECUTE_HANDLER;