gdb: Fix crash when gdb client disconnected in some cases

This commit is contained in:
Coxxs 2025-06-21 05:27:39 +08:00
parent b6f6f8303f
commit 0d7abc0c4e

View file

@ -208,6 +208,7 @@ namespace Ryujinx.HLE.Debugger
while (!_shuttingDown) while (!_shuttingDown)
{ {
IMessage msg = Messages.Take(); IMessage msg = Messages.Take();
try {
switch (msg) switch (msg)
{ {
case BreakInMessage: case BreakInMessage:
@ -234,6 +235,15 @@ namespace Ryujinx.HLE.Debugger
return; return;
} }
} }
catch (IOException e)
{
Logger.Error?.Print(LogClass.GdbStub, "Error while processing GDB messages", e);
}
catch (NullReferenceException e)
{
Logger.Error?.Print(LogClass.GdbStub, "Error while processing GDB messages", e);
}
}
} }
private void ProcessCommand(string cmd) private void ProcessCommand(string cmd)