Compare commits
3 commits
Canary-1.3
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
904d4a7eb0 | ||
|
|
1248a054de | ||
|
|
1bb2af84ce |
2 changed files with 19 additions and 5 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,22 @@ 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.Error?.Print(LogClass.GdbStub,
|
||||||
|
$"Failed to create TCP server on {endpoint} for GDB client: {Enum.GetName(se.SocketErrorCode)}");
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
|
||||||
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)
|
||||||
|
|
@ -22,8 +34,10 @@ namespace Ryujinx.HLE.Debugger
|
||||||
{
|
{
|
||||||
_clientSocket = _listenerSocket.AcceptSocket();
|
_clientSocket = _listenerSocket.AcceptSocket();
|
||||||
}
|
}
|
||||||
catch (SocketException)
|
catch (SocketException se)
|
||||||
{
|
{
|
||||||
|
Logger.Error?.Print(LogClass.GdbStub,
|
||||||
|
$"Failed to accept incoming GDB client connection: {Enum.GetName(se.SocketErrorCode)}");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -31,7 +45,7 @@ namespace Ryujinx.HLE.Debugger
|
||||||
int retries = 10;
|
int retries = 10;
|
||||||
while ((DebugProcess == null || GetThreads().Length == 0) && retries-- > 0)
|
while ((DebugProcess == null || GetThreads().Length == 0) && retries-- > 0)
|
||||||
{
|
{
|
||||||
Thread.Sleep(200);
|
Thread.Sleep(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DebugProcess == null || GetThreads().Length == 0)
|
if (DebugProcess == null || GetThreads().Length == 0)
|
||||||
|
|
|
||||||
|
|
@ -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