ThreadStateManager
A thread state manager.
struct ThreadStateManager
Creating a Thread State Manager
init(thread: Mach.Thread
) Creates a thread state manager.
let port: Mach.Thread
The thread port.
Managing General State
var generalState: arm_thread_state64_t
The general state of the thread.
func setGeneralState(to: arm_thread_state64_t
) throws Sets the general state of the thread.
var armState32: arm_thread_state32_t
The ARM state of the thread (32-bit).
func setARMState32(to: arm_thread_state32_t
) throws Sets the ARM state of the thread (32-bit).
var armState64: arm_thread_state64_t
The ARM state of the thread (64-bit).
func setARMState64(to: arm_thread_state64_t
) throws Sets the ARM state of the thread (64-bit).
Managing Exception State
var exceptionState: arm_exception_state64_t
The exception state of the thread.
func setExceptionState(to: arm_exception_state64_t
) throws Sets the exception state of the thread.
var armExceptionState32: arm_exception_state32_t
The ARM exception state of the thread (32-bit).
func setARMExceptionState32(to: arm_exception_state32_t
) throws Sets the ARM exception state of the thread (32-bit).
var armExceptionState64: arm_exception_state64_t
The ARM exception state of the thread (64-bit).
func setARMExceptionState64(to: arm_exception_state64_t
) throws Sets the ARM exception state of the thread (64-bit).
Managing Debug State
var debugState: arm_debug_state64_t
The debug state of the thread.
func setDebugState(to: arm_debug_state64_t
) throws Sets the debug state of the thread.
var armDebugState32: arm_debug_state32_t
The ARM debug state of the thread (32-bit).
func setARMDebugState32(to: arm_debug_state32_t
) throws Sets the ARM debug state of the thread (32-bit).
var armDebugState32Legacy: arm_debug_state_t
The legacy (pre-Armv8) ARM debug state of the thread (32-bit).
func setARMDebugState32Legacy(to: arm_debug_state_t
) throws Sets the legacy (pre-Armv8) ARM debug state of the thread (32-bit).
var armDebugState64: arm_debug_state64_t
The ARM debug state of the thread (64-bit).
func setARMDebugState64(to: arm_debug_state64_t
) throws Sets the ARM debug state of the thread (64-bit).
Managing Other State
var armVFPState: arm_vfp_state_t
The ARM VFP state of the thread.
func setARMVFPState(to: arm_vfp_state_t
) throws Sets the ARM VFP state of the thread.
var floatState: arm_vfp_state_t
The floating-point state of the thread.
var pageInState: arm_pagein_state_t
The page-in state of the thread.
var armPageInState: arm_pagein_state_t
The ARM page-in state of the thread.
Getting ARM NEON State (macOS 15+, Experimental)
struct ARMNEONState32
An ARM NEON state of a thread (32-bit).
struct ARMNEONState64
An ARM NEON state of a thread (64-bit).
var armNEONState64: ARMNEONState64
The ARM NEON state of the thread (64-bit).
var armNEONState32: ARMNEONState32
The ARM NEON state of the thread (32-bit).
Converting State
struct ThreadStateConvertDirection
A direction for converting thread states.
static func convert<DataType>(DataType, withFlavor: Mach.ThreadStateFlavor, thread: Mach.Thread, direction: Mach.ThreadStateConvertDirection
) throws -> DataType Converts a thread state either to or from the current thread.
static func convert<DataType>(DataType, withFlavor: Mach.ThreadStateFlavor, toThread: Mach.Thread
) throws -> DataType Converts a thread state from the current thread to another thread.
static func convert<DataType>(DataType, withFlavor: Mach.ThreadStateFlavor, fromThread: Mach.Thread
) throws -> DataType Converts a thread state from another thread to the current thread.