gdb: [ci skip] just had a brain wave

This commit is contained in:
GreemDev 2025-10-20 21:20:41 -05:00
parent 71eb844dd8
commit 7d65611b96
2 changed files with 3 additions and 4 deletions

View file

@ -28,10 +28,9 @@ namespace Ryujinx.HLE.Debugger
private static readonly Dictionary<string[], Func<Debugger, string>> _rcmdDelegates = new(); private static readonly Dictionary<string[], Func<Debugger, string>> _rcmdDelegates = new();
[CanBeNull]
public static Func<Debugger, string> FindRcmdDelegate(string command) public static Func<Debugger, string> FindRcmdDelegate(string command)
{ {
Func<Debugger, string> searchResult = null; Func<Debugger, string> searchResult = _ => $"Unknown command: {command}\n";
foreach ((string[] names, Func<Debugger, string> dlg) in _rcmdDelegates) foreach ((string[] names, Func<Debugger, string> dlg) in _rcmdDelegates)
{ {

View file

@ -422,9 +422,9 @@ namespace Ryujinx.HLE.Debugger.Gdb
string command = Helpers.FromHex(hexCommand); string command = Helpers.FromHex(hexCommand);
Logger.Debug?.Print(LogClass.GdbStub, $"Received Rcmd: {command}"); Logger.Debug?.Print(LogClass.GdbStub, $"Received Rcmd: {command}");
var rcmdDelegate = Debugger.FindRcmdDelegate(command); Func<Debugger, string> rcmd = Debugger.FindRcmdDelegate(command);
Processor.ReplyHex(rcmdDelegate?.Invoke(Debugger) ?? $"Unknown command: {command}\n"); Processor.ReplyHex(rcmd(Debugger));
} }
catch (Exception e) catch (Exception e)
{ {