From 0ac11c2b5db35e8478ac20ec7465fbd92a0cb9b6 Mon Sep 17 00:00:00 2001 From: merry Date: Sat, 19 Feb 2022 16:12:19 +0000 Subject: [PATCH] Implement qThreadExtraInfo --- ARMeilleure/State/DebugState.cs | 2 +- ARMeilleure/State/ExecutionContext.cs | 5 +++++ Ryujinx.HLE/Debugger/Debugger.cs | 21 +++++++++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/ARMeilleure/State/DebugState.cs b/ARMeilleure/State/DebugState.cs index dd05ddb61..0b00781fe 100644 --- a/ARMeilleure/State/DebugState.cs +++ b/ARMeilleure/State/DebugState.cs @@ -1,6 +1,6 @@ namespace ARMeilleure.State { - enum DebugState + public enum DebugState { Running, Stopping, diff --git a/ARMeilleure/State/ExecutionContext.cs b/ARMeilleure/State/ExecutionContext.cs index 5ccf1b26f..985a97acd 100644 --- a/ARMeilleure/State/ExecutionContext.cs +++ b/ARMeilleure/State/ExecutionContext.cs @@ -168,6 +168,11 @@ namespace ARMeilleure.State _debugHalt.Set(); } + public DebugState GetDebugState() + { + return (DebugState)_debugState; + } + internal void OnBreak(ulong address, int imm) { Break?.Invoke(this, new InstExceptionEventArgs(address, imm)); diff --git a/Ryujinx.HLE/Debugger/Debugger.cs b/Ryujinx.HLE/Debugger/Debugger.cs index 2239e5f80..28a150ab3 100644 --- a/Ryujinx.HLE/Debugger/Debugger.cs +++ b/Ryujinx.HLE/Debugger/Debugger.cs @@ -297,6 +297,27 @@ namespace Ryujinx.HLE.Debugger break; } + if (ss.ConsumePrefix("ThreadExtraInfo,")) + { + ulong? threadId = ss.ReadRemainingAsThreadUid(); + if (threadId == null) + { + ReplyError(); + break; + } + + ExecutionContext ctx = GetThread(threadId.Value); + if (ctx.GetDebugState() == DebugState.Stopped) + { + Reply(ToHex("Stopped")); + } + else + { + Reply(ToHex("Not stopped")); + } + break; + } + if (ss.ConsumePrefix("Xfer:features:read:")) { string feature = ss.ReadUntil(':');