diff --git a/src/ARMeilleure/Instructions/NativeInterface.cs b/src/ARMeilleure/Instructions/NativeInterface.cs index d43e20d83..c44f24b7c 100644 --- a/src/ARMeilleure/Instructions/NativeInterface.cs +++ b/src/ARMeilleure/Instructions/NativeInterface.cs @@ -3,6 +3,7 @@ using ARMeilleure.State; using ARMeilleure.Translation; using System; using System.Runtime.InteropServices; +using System.Threading; using ExecutionContext = ARMeilleure.State.ExecutionContext; namespace ARMeilleure.Instructions diff --git a/src/ARMeilleure/State/ExecutionContext.cs b/src/ARMeilleure/State/ExecutionContext.cs index 0b0a83c9f..2978bf27a 100644 --- a/src/ARMeilleure/State/ExecutionContext.cs +++ b/src/ARMeilleure/State/ExecutionContext.cs @@ -1,4 +1,6 @@ using ARMeilleure.Memory; +using System.Collections.Concurrent; +using System.Diagnostics; using System.Threading; namespace ARMeilleure.State diff --git a/src/Ryujinx.Cpu/Jit/JitExecutionContext.cs b/src/Ryujinx.Cpu/Jit/JitExecutionContext.cs index f00acc1d7..d4775f3ed 100644 --- a/src/Ryujinx.Cpu/Jit/JitExecutionContext.cs +++ b/src/Ryujinx.Cpu/Jit/JitExecutionContext.cs @@ -1,5 +1,6 @@ using ARMeilleure.Memory; using ARMeilleure.State; +using System.Threading; using ExecutionContext = ARMeilleure.State.ExecutionContext; namespace Ryujinx.Cpu.Jit diff --git a/src/Ryujinx.HLE/Debugger/Debugger.cs b/src/Ryujinx.HLE/Debugger/Debugger.cs index 3ec4dbb93..3eebb0b38 100644 --- a/src/Ryujinx.HLE/Debugger/Debugger.cs +++ b/src/Ryujinx.HLE/Debugger/Debugger.cs @@ -47,7 +47,7 @@ namespace Ryujinx.HLE.Debugger MessageHandlerThread.Start(); } - private IDebuggableProcess DebugProcess => Device.System?.DebugGetApplicationProcess(); + private IDebuggableProcess DebugProcess => Device.System.DebugGetApplicationProcess(); private KThread[] GetThreads() => DebugProcess.GetThreadUids().Select(x => DebugProcess.GetThread(x)).ToArray(); private bool IsProcessAarch32 => DebugProcess.GetThread(gThread.Value).Context.IsAarch32; private KernelContext KernelContext => Device.System.KernelContext; @@ -761,20 +761,6 @@ namespace Ryujinx.HLE.Debugger { return; } - - // If the user connects before the application is running, wait for the application to start. - int retries = 10; - while (DebugProcess == null && retries-- > 0) - { - Thread.Sleep(200); - } - if (DebugProcess == null) - { - Logger.Warning?.Print(LogClass.GdbStub, "Application is not running, cannot accept GDB client connection"); - ClientSocket.Close(); - continue; - } - ClientSocket.NoDelay = true; ReadStream = new NetworkStream(ClientSocket, System.IO.FileAccess.Read); WriteStream = new NetworkStream(ClientSocket, System.IO.FileAccess.Write); diff --git a/src/Ryujinx.HLE/HOS/Kernel/Process/KProcess.cs b/src/Ryujinx.HLE/HOS/Kernel/Process/KProcess.cs index 7edf263e2..0c400b425 100644 --- a/src/Ryujinx.HLE/HOS/Kernel/Process/KProcess.cs +++ b/src/Ryujinx.HLE/HOS/Kernel/Process/KProcess.cs @@ -689,7 +689,6 @@ namespace Ryujinx.HLE.HOS.Kernel.Process { mainThread.Suspend(ThreadSchedState.ThreadPauseFlag); debugState = (int)DebugState.Stopped; - Logger.Notice.Print(LogClass.Kernel, $"Application is suspended on start for debugging."); } result = mainThread.Start(); @@ -743,7 +742,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process ExceptionCallback breakCallback = null; ExceptionCallbackNoArgs stepCallback = null; - if (KernelContext.Device.Configuration.EnableGdbStub && KernelContext.Device.Debugger != null) + if (KernelContext.Device.Configuration.EnableGdbStub) { breakCallback = KernelContext.Device.Debugger.BreakHandler; stepCallback = KernelContext.Device.Debugger.StepHandler; diff --git a/src/Ryujinx.HLE/Switch.cs b/src/Ryujinx.HLE/Switch.cs index e1aa8e0e4..ed6d57b2d 100644 --- a/src/Ryujinx.HLE/Switch.cs +++ b/src/Ryujinx.HLE/Switch.cs @@ -176,7 +176,7 @@ namespace Ryujinx.HLE AudioDeviceDriver.Dispose(); FileSystem.Dispose(); Memory.Dispose(); - Debugger?.Dispose(); + Debugger.Dispose(); TitleIDs.CurrentApplication.Value = null; Shared = null;