4 #ifndef _INCLUDE_XNU_THREADS_H_
5 #define _INCLUDE_XNU_THREADS_H_
8 #include <mach/mach_vm.h>
12 #define RZ_REG_T ppc_thread_state_t
13 #define RZ_REG_STATE_T PPC_THREAD_STATE
14 #define RZ_REG_STATE_SZ PPC_THREAD_STATE_SZ
16 #elif __arm || __arm64 || __aarch64
17 #include <mach/arm/thread_status.h>
18 #ifndef ARM_THREAD_STATE
19 #define ARM_THREAD_STATE 1
21 #ifndef ARM_THREAD_STATE64
22 #define ARM_THREAD_STATE64 6
24 #define RZ_REG_T arm_unified_thread_state_t
25 #define RZ_REG_STATE_T MACHINE_THREAD_STATE
26 #define RZ_REG_STATE_SZ MACHINE_THREAD_STATE_COUNT
27 #elif __x86_64__ || __i386__
28 #define RZ_REG_T x86_thread_state_t
29 #define RZ_REG_STATE_T MACHINE_THREAD_STATE
30 #define RZ_REG_STATE_SZ MACHINE_THREAD_STATE_COUNT
33 #define RETURN_ON_MACH_ERROR(msg, retval) \
34 if (kr != KERN_SUCCESS) { \
35 mach_error(msg, kr); \
40 exception_mask_t
masks[EXC_TYPES_COUNT];
41 mach_port_t
ports[EXC_TYPES_COUNT];
43 thread_state_flavor_t
flavors[EXC_TYPES_COUNT];
58 #if __arm64 || __aarch64 || __arm64__ || __aarch64__
60 arm_debug_state32_t drx32;
61 arm_debug_state64_t drx64;
63 #elif __arm__ || __arm || __armv7__
65 arm_debug_state_t drx;
67 #elif __x86_64__ || __i386__
68 x86_debug_state_t drx;
75 mach_msg_header_t
hdr;
79 mach_msg_port_descriptor_t
task;
97 mach_msg_header_t
hdr;
static static fork const void static count static fd const char const char static newpath char char char static envp time_t static t const char static mode static whence const char static dir time_t static t unsigned static seconds const char struct utimbuf static buf static inc pid
mach_msg_port_descriptor_t task
exception_type_t exception
mach_msg_type_number_t code_cnt
mach_msg_port_descriptor_t thread
mach_msg_type_number_t count
mach_port_t exception_port
mach_port_t ports[EXC_TYPES_COUNT]
thread_state_flavor_t flavors[EXC_TYPES_COUNT]
exception_mask_t masks[EXC_TYPES_COUNT]
exception_behavior_t behaviors[EXC_TYPES_COUNT]
thread_basic_info_data_t basic_info
RZ_IPI bool rz_xnu_thread_set_gpr(RzDebug *dbg, xnu_thread_t *thread)
struct _exception_info xnu_exception_info
RZ_IPI int rz_xnu_update_thread_list(RzDebug *dbg)
RZ_IPI xnu_thread_t * rz_xnu_get_thread(RzDebug *dbg, int tid)
RZ_IPI thread_t rz_xnu_get_cur_thread(RzDebug *dbg)
RZ_IPI bool rz_xnu_thread_set_drx(RzDebug *dbg, xnu_thread_t *thread)
RZ_IPI bool rz_xnu_thread_get_gpr(RzDebug *dbg, xnu_thread_t *thread)
RZ_IPI bool xnu_restore_exception_ports(int pid)
RZ_IPI RzDebugReasonType xnu_wait_for_exception(RzDebug *dbg, int pid, ut32 timeout_ms, bool quiet_signal)
struct _xnu_thread xnu_thread_t
RZ_IPI bool rz_xnu_thread_get_drx(RzDebug *dbg, xnu_thread_t *thread)
RZ_IPI bool xnu_create_exception_thread(RzDebug *dbg)
static bool xnu_set_trace_bit(RzDebug *dbg, xnu_thread_t *th)
static bool xnu_clear_trace_bit(RzDebug *dbg, xnu_thread_t *th)
RZ_IPI bool xnu_modify_trace_bit(RzDebug *dbg, xnu_thread_t *th, int enable)