Handle GDB server reconnections

This commit is contained in:
svc64 2023-10-06 17:35:23 +03:00
parent 5e65fd8808
commit de4ec65bd7

View file

@ -6,6 +6,7 @@ using Ryujinx.HLE.HOS.Kernel;
using Ryujinx.HLE.HOS.Kernel.Threading;
using System;
using System.Collections.Concurrent;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Sockets;
@ -615,6 +616,8 @@ namespace Ryujinx.HLE.Debugger
Logger.Notice.Print(LogClass.GdbStub, "GDB client connected");
while (true)
{
try
{
switch (ReadStream.ReadByte())
{
@ -653,9 +656,17 @@ namespace Ryujinx.HLE.Debugger
break;
}
}
catch (IOException)
{
goto eof;
}
}
eof:
Logger.Notice.Print(LogClass.GdbStub, "GDB client lost connection");
ReadStream.Close();
WriteStream.Close();
ClientSocket.Close();
}
}