Merge branch 'exception-minidump' into 'master'

Create minidump at ProcessUnhandledException

See merge request [ryubing/ryujinx!217](https://git.ryujinx.app/ryubing/ryujinx/-/merge_requests/217)
This commit is contained in:
Coxxs 2025-12-07 18:26:06 -06:00
commit 4288fc4148
2 changed files with 29 additions and 0 deletions

View file

@ -510,6 +510,11 @@ namespace Ryujinx.HLE.HOS
}
}
public string DebugGetApplicationProcessMinidump()
{
return DebugGetApplicationProcess()?.Debugger?.GetMinidump();
}
internal KProcess DebugGetApplicationProcess()
{
lock (KernelContext.Processes)

View file

@ -382,6 +382,30 @@ namespace Ryujinx.Ava
exceptions.Add(initialException);
}
if (isTerminating && HLE.Switch.Shared is { } device)
{
try
{
// Print a short message first just in case it crashes again during minidump creation (should not happen)
Logger.Error?.Print(LogClass.Application, $"Unhandled exception caught: {initialException.GetType().Name}. Creating guest program minidump...");
var minidump = device.System?.DebugGetApplicationProcessMinidump();
if (minidump == null)
{
Logger.Warning?.Print(LogClass.Application, "Failed to create minidump");
}
else
{
Logger.Info?.Print(LogClass.Application, minidump);
}
}
catch (Exception e)
{
Logger.Error?.Print(LogClass.Application, $"Failed to create minidump: {e.Message}");
}
}
foreach (Exception e in exceptions)
{
string message = $"Unhandled exception caught: {e}";