mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-12-12 07:36:59 +00:00
gdb: Catch SocketException from TcpListener#Start
This commit is contained in:
parent
886981004d
commit
1bb2af84ce
2 changed files with 14 additions and 3 deletions
|
|
@ -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();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue