[UI] Added build to exception message

This commit is contained in:
Adrian 2023-02-05 13:45:12 +00:00 committed by Radosław Gliński
parent 3d3810fa98
commit 333d7c2767
1 changed files with 19 additions and 9 deletions

View File

@ -17,6 +17,9 @@
#include "xenia/ui/windowed_app.h"
#include "xenia/ui/windowed_app_context_win.h"
// Autogenerated by `xb premake`.
#include "build/version.h"
DEFINE_bool(enable_console, false, "Open a console window with the main window",
"Logging");
@ -230,16 +233,23 @@ static bool exception_pointers_handler(HostExceptionReport* report) {
DWORD64 last_rip = report->ExceptionInfo->ContextRecord->Rip;
DWORD except_code = report->ExceptionInfo->ExceptionRecord->ExceptionCode;
char except_message_buf[256];
sprintf_s(except_message_buf,
"Exception encountered!\nException address: %s\nStackpointer: "
"%s\nInstruction pointer: %s\nExceptionCode: 0x%X (%s)\n",
report->GetFormattedAddress(exception_addr),
report->GetFormattedAddress(last_stackpointer),
report->GetFormattedAddress(last_rip), except_code,
HostExceptionReport::ChompNewlines(Ntstatus_msg(except_code)));
std::string build = (
#ifdef XE_BUILD_IS_PR
"PR#" XE_BUILD_PR_NUMBER " " XE_BUILD_PR_REPO " " XE_BUILD_PR_BRANCH
"@" XE_BUILD_PR_COMMIT_SHORT " against "
#endif
XE_BUILD_BRANCH "@" XE_BUILD_COMMIT_SHORT " on " XE_BUILD_DATE);
report->AddString(except_message_buf);
const std::string except_message = fmt::format(
"Exception encountered!\nBuild: {}\nException address: "
"{}\nStackpointer: "
"{}\nInstruction pointer: {}\nExceptionCode: 0x{} ({})\n",
build.c_str(), report->GetFormattedAddress(exception_addr),
report->GetFormattedAddress(last_stackpointer),
report->GetFormattedAddress(last_rip), except_code,
HostExceptionReport::ChompNewlines(Ntstatus_msg(except_code)));
report->AddString(except_message.c_str());
return true;
}