Add comments on debug stuff & fix warnings

This commit is contained in:
svc64 2023-10-06 15:53:17 +03:00
parent 65d7a16a87
commit 0c57663ea3
3 changed files with 28 additions and 7 deletions

View File

@ -176,7 +176,8 @@ namespace ARMeilleure.Instructions
Statistics.PauseTimer();
ExecutionContext context = GetContext();
// If debugging, we'll handle interrupts outside
if (Optimizations.EnableDebugging && context.Interrupted)
{
return false;

View File

@ -102,10 +102,8 @@ namespace ARMeilleure.State
private readonly ExceptionCallback _undefinedCallback;
internal int ShouldStep;
internal int DebugStopped;
public ulong DebugPc; // This is only valid while debugging is enabled.
public Barrier StepBarrier = new Barrier(2);
public ulong DebugPc { get; set; }
public Barrier StepBarrier { get; }
public ExecutionContext(
IJitMemoryAllocator allocator,
@ -123,6 +121,7 @@ namespace ARMeilleure.State
_undefinedCallback = undefinedCallback;
Running = true;
StepBarrier = new Barrier(2);
_nativeContext.SetCounter(MinCountForCheck);
}

View File

@ -115,10 +115,31 @@ namespace Ryujinx.Cpu
/// </remarks>
void StopRunning();
// TODO: comments
/// <summary>
/// Requests the thread to stop running temporarily and call <see cref="ExceptionCallbacks.InterruptCallback"/>.
/// </summary>
/// <remarks>
/// The thread might not pause immediately.
/// One must not assume that guest code is no longer being executed by the thread after calling this function.
/// After single stepping, the thread should signal and wait on <see cref="StepBarrier"/> twice to allow
/// changing the thread state after stepping.
/// </remarks>
void RequestDebugStep();
ulong DebugPc { get; set; }
/// <summary>
/// Step barrier
/// </summary>
/// <remarks>
/// Should be signaled and waited on twice after single-stepping.
/// </remarks>
Barrier StepBarrier { get; }
/// <summary>
/// Current Program Counter (for debugging).
/// </summary>
/// <remarks>
/// PC register for the debugger. Must not be accessed while the thread isn't stopped for debugging.
/// </remarks>
ulong DebugPc { get; set; }
}
}