diff --git a/src/Ryujinx.HLE/Debugger/BreakpointManager.cs b/src/Ryujinx.HLE/Debugger/BreakpointManager.cs index ae42fb87a..2a2233cef 100644 --- a/src/Ryujinx.HLE/Debugger/BreakpointManager.cs +++ b/src/Ryujinx.HLE/Debugger/BreakpointManager.cs @@ -9,12 +9,9 @@ namespace Ryujinx.HLE.Debugger { public byte[] OriginalData { get; } - public bool IsStep { get; } - - public Breakpoint(byte[] originalData, bool isStep) + public Breakpoint(byte[] originalData) { OriginalData = originalData; - IsStep = isStep; } } @@ -42,7 +39,7 @@ namespace Ryujinx.HLE.Debugger /// The length of the instruction to replace. /// Indicates if this is a single-step breakpoint. /// True if the breakpoint was set successfully; otherwise, false. - public bool SetBreakPoint(ulong address, ulong length, bool isStep = false) + public bool SetBreakPoint(ulong address, ulong length) { if (_breakpoints.ContainsKey(address)) { @@ -69,7 +66,7 @@ namespace Ryujinx.HLE.Debugger return false; } - var breakpoint = new Breakpoint(originalInstruction, isStep); + var breakpoint = new Breakpoint(originalInstruction); if (_breakpoints.TryAdd(address, breakpoint)) { Logger.Debug?.Print(LogClass.GdbStub, $"Breakpoint set at 0x{address:X16}"); @@ -122,30 +119,6 @@ namespace Ryujinx.HLE.Debugger Logger.Debug?.Print(LogClass.GdbStub, "All breakpoints cleared."); } - /// - /// Clears all currently set single-step software breakpoints. - /// - public void ClearAllStepBreakpoints() - { - var stepBreakpoints = _breakpoints.Where(p => p.Value.IsStep).ToList(); - - if (stepBreakpoints.Count == 0) - { - return; - } - - foreach (var bp in stepBreakpoints) - { - if (_breakpoints.TryRemove(bp.Key, out Breakpoint removedBreakpoint)) - { - WriteMemory(bp.Key, removedBreakpoint.OriginalData); - } - } - - Logger.Debug?.Print(LogClass.GdbStub, "All step breakpoints cleared."); - } - - private byte[] GetBreakInstruction(ulong length) { if (_debugger.IsProcessAarch32) diff --git a/src/Ryujinx.HLE/Debugger/Debugger.cs b/src/Ryujinx.HLE/Debugger/Debugger.cs index 45c2ba339..58b5192bb 100644 --- a/src/Ryujinx.HLE/Debugger/Debugger.cs +++ b/src/Ryujinx.HLE/Debugger/Debugger.cs @@ -103,6 +103,10 @@ namespace Ryujinx.HLE.Debugger { Logger.Error?.Print(LogClass.GdbStub, "Error while processing GDB messages", e); } + catch (ObjectDisposedException e) + { + Logger.Error?.Print(LogClass.GdbStub, "Error while processing GDB messages", e); + } } } @@ -304,6 +308,7 @@ namespace Ryujinx.HLE.Debugger WriteStream = null; ClientSocket.Close(); ClientSocket = null; + CommandProcessor = null; BreakpointManager.ClearAll(); } diff --git a/src/Ryujinx.HLE/Debugger/Gdb/CommandProcessor.cs b/src/Ryujinx.HLE/Debugger/Gdb/CommandProcessor.cs index 19b3b7a2b..e9986647d 100644 --- a/src/Ryujinx.HLE/Debugger/Gdb/CommandProcessor.cs +++ b/src/Ryujinx.HLE/Debugger/Gdb/CommandProcessor.cs @@ -310,7 +310,7 @@ namespace Ryujinx.HLE.Debugger.Gdb switch (type) { case "0": // Software breakpoint - if (!Commands.Debugger.BreakpointManager.SetBreakPoint(addr, len, false)) + if (!Commands.Debugger.BreakpointManager.SetBreakPoint(addr, len)) { Commands.ReplyError(); return; @@ -325,7 +325,7 @@ namespace Ryujinx.HLE.Debugger.Gdb Commands.ReplyError(); return; default: - Commands. ReplyError(); + Commands.ReplyError(); return; } } diff --git a/src/Ryujinx.HLE/Debugger/RegisterInformation.cs b/src/Ryujinx.HLE/Debugger/RegisterInformation.cs index 47e4304ea..c1c576558 100644 --- a/src/Ryujinx.HLE/Debugger/RegisterInformation.cs +++ b/src/Ryujinx.HLE/Debugger/RegisterInformation.cs @@ -17,7 +17,7 @@ namespace Ryujinx.HLE.Debugger private static string GetEmbeddedResourceContent(string resourceName) { - Stream stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("Ryujinx.HLE.Debugger.GdbXml." + resourceName); + Stream stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("Ryujinx.HLE.Debugger.Gdb.Xml." + resourceName); StreamReader reader = new(stream); string result = reader.ReadToEnd(); reader.Dispose();