// Copyright (C) 2026 SharpEmu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later using SharpEmu.HLE; namespace SharpEmu.Core.Cpu.Debugging; /// /// A live view of the guest CPU state at a dispatch boundary, handed to an /// so a debugger can read and mutate registers and /// guest memory without taking a dependency on the concrete /// CpuContext/CpuDispatcher types. /// /// /// The frame instance is only valid for the duration of the hook call that /// receives it (between and the /// matching ). Reads and writes are /// forwarded straight to the underlying guest context, so mutations made from /// a hook are observed by the CPU backend when it resumes the frame. /// public interface ICpuDebugFrame { /// The kind of frame being executed. CpuDebugFrameKind Kind { get; } /// The guest ABI generation this frame targets. Generation Generation { get; } /// The guest virtual address the frame begins executing at. ulong EntryPoint { get; } /// /// A human-readable label for the frame (process image name or module name). /// string Label { get; } /// Guest-addressable memory for this frame. ICpuMemory Memory { get; } /// Reads a general-purpose register. ulong GetRegister(CpuRegister register); /// Overwrites a general-purpose register. void SetRegister(CpuRegister register, ulong value); /// The instruction pointer. ulong Rip { get; set; } /// The flags register. ulong Rflags { get; set; } /// The FS segment base (guest TLS pointer). ulong FsBase { get; } /// The GS segment base. ulong GsBase { get; } /// Reads the 128-bit value of an XMM register. void GetXmm(int registerIndex, out ulong low, out ulong high); /// /// The import stubs (guest address to NID) resolved for this frame, so a /// debugger can annotate calls into HLE exports. /// IReadOnlyDictionary ImportStubs { get; } }