Rizin
unix-like reverse engineering framework and cli tools
|
Go to the source code of this file.
Classes | |
struct | _exception_info |
struct | _xnu_thread |
struct | _exc_msg |
struct | _rep_msg |
Macros | |
#define | RETURN_ON_MACH_ERROR(msg, retval) |
Typedefs | |
typedef struct _exception_info | xnu_exception_info |
typedef struct _xnu_thread | xnu_thread_t |
typedef struct _exc_msg | exc_msg |
typedef struct _rep_msg | rep_msg |
Functions | |
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_set_gpr (RzDebug *dbg, xnu_thread_t *thread) |
RZ_IPI bool | rz_xnu_thread_get_gpr (RzDebug *dbg, xnu_thread_t *thread) |
RZ_IPI bool | rz_xnu_thread_get_drx (RzDebug *dbg, xnu_thread_t *thread) |
RZ_IPI bool | xnu_modify_trace_bit (RzDebug *dbg, xnu_thread_t *th, int enable) |
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_create_exception_thread (RzDebug *dbg) |
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) |
#define RETURN_ON_MACH_ERROR | ( | msg, | |
retval | |||
) |
Definition at line 33 of file xnu_threads.h.
typedef struct _exception_info xnu_exception_info |
typedef struct _xnu_thread xnu_thread_t |
Definition at line 402 of file xnu_threads.c.
References dbg, memcpy(), NULL, rz_debug_t::pid, pid_to_task(), and threads.
Referenced by rz_xnu_get_thread(), xnu_continue(), xnu_reg_read(), xnu_reg_write(), and xnu_step().
RZ_IPI xnu_thread_t* rz_xnu_get_thread | ( | RzDebug * | dbg, |
int | tid | ||
) |
Definition at line 378 of file xnu_threads.c.
References rz_list_iter_t::data, dbg, eprintf, NULL, rz_list_find(), rz_xnu_get_cur_thread(), rz_xnu_update_thread_list(), thread_find(), and rz_debug_t::threads.
Referenced by xnu_continue(), xnu_map_alloc(), xnu_map_dealloc(), xnu_reg_read(), xnu_reg_write(), and xnu_step().
RZ_IPI bool rz_xnu_thread_get_drx | ( | RzDebug * | dbg, |
xnu_thread_t * | thread | ||
) |
Definition at line 26 of file xnu_threads.c.
References rz_debug_t::bits, _xnu_thread::count, dbg, _xnu_thread::flavor, LOG_MACH_ERROR, _xnu_thread::port, rz_return_val_if_fail, RZ_SYS_BITS_64, _xnu_thread::state, _xnu_thread::state_size, and x86_DEBUG_STATE.
Referenced by xnu_reg_read().
RZ_IPI bool rz_xnu_thread_get_gpr | ( | RzDebug * | dbg, |
xnu_thread_t * | thread | ||
) |
Definition at line 184 of file xnu_threads.c.
References rz_debug_t::bits, _xnu_thread::count, dbg, _xnu_thread::flavor, _xnu_thread::gpr, LOG_MACH_ERROR, _xnu_thread::port, regs, rz_return_val_if_fail, RZ_SYS_BITS_64, _xnu_thread::state, _xnu_thread::state_size, x86_THREAD_STATE, and x86_THREAD_STATE_COUNT.
Referenced by xnu_reg_read(), and xnu_thread_list().
RZ_IPI bool rz_xnu_thread_set_drx | ( | RzDebug * | dbg, |
xnu_thread_t * | thread | ||
) |
Definition at line 70 of file xnu_threads.c.
References rz_debug_t::bits, _xnu_thread::count, dbg, _xnu_thread::flavor, LOG_MACH_ERROR, _xnu_thread::port, regs, rz_return_val_if_fail, RZ_SYS_BITS_64, x86_DEBUG_STATE, x86_DEBUG_STATE32, and x86_DEBUG_STATE64.
Referenced by xnu_reg_write().
RZ_IPI bool rz_xnu_thread_set_gpr | ( | RzDebug * | dbg, |
xnu_thread_t * | thread | ||
) |
Definition at line 130 of file xnu_threads.c.
References rz_debug_t::bits, _xnu_thread::count, dbg, _xnu_thread::flavor, _xnu_thread::gpr, if(), LOG_MACH_ERROR, _xnu_thread::port, regs, rz_return_val_if_fail, RZ_SYS_BITS_64, _xnu_thread::state, _xnu_thread::state_size, x86_THREAD_STATE, x86_THREAD_STATE32, x86_THREAD_STATE64, x86_THREAD_STATE64_COUNT, and x86_THREAD_STATE_COUNT.
Referenced by xnu_reg_write().
Definition at line 290 of file xnu_threads.c.
References dbg, eprintf, i, NULL, rz_debug_t::pid, pid_to_task(), _xnu_thread::port, rz_list_append(), rz_list_delete(), rz_list_find(), rz_list_newf(), thread_find(), rz_debug_t::threads, xnu_get_thread_with_info(), xnu_thread_free(), and xnu_update_thread_info().
Referenced by rz_xnu_get_thread(), and xnu_thread_list().
|
inlinestatic |
Definition at line 114 of file xnu_threads.h.
References dbg, and xnu_modify_trace_bit().
Referenced by xnu_continue().
Definition at line 479 of file xnu_excthreads.c.
References _exception_info::behaviors, _exception_info::count, dbg, eprintf, ex, _exception_info::exception_port, _exception_info::flavors, _exception_info::masks, rz_debug_t::pid, pid_to_task(), _exception_info::ports, and RETURN_ON_MACH_ERROR.
Referenced by xnu_attach().
RZ_IPI bool xnu_modify_trace_bit | ( | RzDebug * | dbg, |
xnu_thread_t * | th, | ||
int | enable | ||
) |
Referenced by xnu_clear_trace_bit(), and xnu_set_trace_bit().
Definition at line 226 of file xnu_excthreads.c.
References _exception_info::behaviors, _exception_info::count, eprintf, ex, _exception_info::exception_port, _exception_info::flavors, i, _exception_info::masks, pid, pid_to_task(), and _exception_info::ports.
Referenced by xnu_detach().
|
inlinestatic |
Definition at line 111 of file xnu_threads.h.
References dbg, and xnu_modify_trace_bit().
Referenced by xnu_step().
RZ_IPI RzDebugReasonType xnu_wait_for_exception | ( | RzDebug * | dbg, |
int | pid, | ||
ut32 | timeout_ms, | ||
bool | quiet_signal | ||
) |
Wait for a Mach exception, reply to it and handle it.
timeout_ms | if zero, wait infinitely, otherwise specifies a timeout for receiving |
quiet_signal | don't print when receiving a standard unix signal |
Definition at line 409 of file xnu_excthreads.c.
References dbg, encode_reply(), eprintf, ex, _exception_info::exception_port, handle_dead_notify(), handle_exception_message(), msg, RZ_DEBUG_REASON_DEAD, RZ_DEBUG_REASON_ERROR, RZ_DEBUG_REASON_MACH_RCV_INTERRUPTED, RZ_DEBUG_REASON_UNKNOWN, rz_debug_reg_get(), RZ_LOG_ERROR, rz_return_val_if_fail, rz_debug_t::stopaddr, and validate_mach_message().
Referenced by xnu_attach(), and xnu_wait().