gdb: Catch SocketException from TcpListener#Start

This commit is contained in:
GreemDev authored and KeatonTheBot committed 2025-10-22 08:09:48 -05:00
1 parent a369b246a3
commit b8aaadac5f
2 files changed
+14 -3

No files matched your search

@@ -1,5 +1,6 @@
using Ryujinx.Common.Logging;
using Ryujinx.HLE.Debugger.Gdb;
using System;
using System.IO;
using System.Net;
using System.Net.Sockets;
@@ -9,11 +10,21 @@ namespace Ryujinx.HLE.Debugger
{
public partial class Debugger
{
private void DebuggerThreadMain()
private void MainLoop()
{
IPEndPoint endpoint = new(IPAddress.Any, GdbStubPort);
_listenerSocket = new TcpListener(endpoint);
_listenerSocket.Start();
try
{
_listenerSocket.Start();
}
catch (SocketException se)
{
Logger.Notice.Print(LogClass.GdbStub, $"Failed to create TCP client for GDB client: {Enum.GetName(se.SocketErrorCode)}");
return;
}
Logger.Notice.Print(LogClass.GdbStub, $"Currently waiting on {endpoint} for GDB client");
while (!_shuttingDown)
+1 -1
View File
@@ -45,7 +45,7 @@ namespace Ryujinx.HLE.Debugger
ARMeilleure.Optimizations.EnableDebugging = true;
_debuggerThread = new Thread(DebuggerThreadMain);
_debuggerThread = new Thread(MainLoop);
_debuggerThread.Start();
_messageHandlerThread = new Thread(MessageHandlerMain);
_messageHandlerThread.Start();