mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-10-04 05:18:56 +02:00
Flush the error log before exit
Currently, some logs can be missing when a fatal error occurs (especially GuestBrokeExecutionException). This MR attempts to flush logs to console and file before process exit.
This commit is contained in:
@@ -1068,6 +1068,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
|
||||
|
||||
Logger.Error?.Print(LogClass.Cpu, $"Invalid memory access at virtual address 0x{va:X16}.");
|
||||
|
||||
Logger.Flush();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1076,6 +1078,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
|
||||
KernelStatic.GetCurrentThread().PrintGuestStackTrace();
|
||||
KernelStatic.GetCurrentThread()?.PrintGuestRegisterPrintout();
|
||||
|
||||
Logger.Flush();
|
||||
|
||||
throw new UndefinedInstructionException(address, opCode);
|
||||
}
|
||||
|
||||
|
||||
@@ -1885,6 +1885,9 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
|
||||
return;
|
||||
}
|
||||
|
||||
Logger.Error?.Print(LogClass.KernelSvc, "The guest program broke execution!");
|
||||
Logger.Flush();
|
||||
|
||||
// TODO: Debug events.
|
||||
currentThread.Owner.TerminateCurrentProcess();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user