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 a2b35ecce3
commit eb8b35b170

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)