mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2026-05-06 13:25:46 +00:00
gdb: Catch SocketException from TcpListener#Start
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
using Ryujinx.Common.Logging;
|
using Ryujinx.Common.Logging;
|
||||||
using Ryujinx.HLE.Debugger.Gdb;
|
using Ryujinx.HLE.Debugger.Gdb;
|
||||||
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Sockets;
|
using System.Net.Sockets;
|
||||||
@@ -9,11 +10,21 @@ namespace Ryujinx.HLE.Debugger
|
|||||||
{
|
{
|
||||||
public partial class Debugger
|
public partial class Debugger
|
||||||
{
|
{
|
||||||
private void DebuggerThreadMain()
|
private void MainLoop()
|
||||||
{
|
{
|
||||||
IPEndPoint endpoint = new(IPAddress.Any, GdbStubPort);
|
IPEndPoint endpoint = new(IPAddress.Any, GdbStubPort);
|
||||||
_listenerSocket = new TcpListener(endpoint);
|
_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");
|
Logger.Notice.Print(LogClass.GdbStub, $"Currently waiting on {endpoint} for GDB client");
|
||||||
|
|
||||||
while (!_shuttingDown)
|
while (!_shuttingDown)
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ namespace Ryujinx.HLE.Debugger
|
|||||||
|
|
||||||
ARMeilleure.Optimizations.EnableDebugging = true;
|
ARMeilleure.Optimizations.EnableDebugging = true;
|
||||||
|
|
||||||
_debuggerThread = new Thread(DebuggerThreadMain);
|
_debuggerThread = new Thread(MainLoop);
|
||||||
_debuggerThread.Start();
|
_debuggerThread.Start();
|
||||||
_messageHandlerThread = new Thread(MessageHandlerMain);
|
_messageHandlerThread = new Thread(MessageHandlerMain);
|
||||||
_messageHandlerThread.Start();
|
_messageHandlerThread.Start();
|
||||||
|
|||||||
Reference in New Issue
Block a user