Rizin
unix-like reverse engineering framework and cli tools
|
#include <limits.h>
#include <sys/ptrace.h>
#include <sys/user.h>
Go to the source code of this file.
Classes | |
struct | user_regs_struct_x86_64 |
struct | user_regs_struct_x86_32 |
Macros | |
#define | TRAP_BRKPT 1 |
#define | TRAP_TRACE 2 |
#define | TRAP_BRANCH 3 |
#define | TRAP_HWBKPT 4 |
#define | TRAP_UNK 5 |
Functions | |
bool | linux_set_options (RzDebug *dbg, int pid) |
int | linux_step (RzDebug *dbg) |
RzDebugReasonType | linux_ptrace_event (RzDebug *dbg, int pid, int status, bool dowait) |
int | linux_attach (RzDebug *dbg, int pid) |
bool | linux_attach_new_process (RzDebug *dbg, int pid) |
RzDebugInfo * | linux_info (RzDebug *dbg, const char *arg) |
RzList * | linux_pid_list (int pid, RzList *list) |
RzList * | linux_thread_list (RzDebug *dbg, int pid, RzList *list) |
bool | linux_select (RzDebug *dbg, int pid, int tid) |
RzDebugPid * | fill_pid_info (const char *info, const char *path, int tid) |
int | linux_reg_read (RzDebug *dbg, int type, ut8 *buf, int size) |
int | linux_reg_write (RzDebug *dbg, int type, const ut8 *buf, int size) |
RzList * | linux_desc_list (int pid) |
bool | linux_stop_threads (RzDebug *dbg, int except) |
int | linux_handle_signals (RzDebug *dbg, int tid) |
int | linux_dbg_wait (RzDebug *dbg, int pid) |
char * | linux_reg_profile (RzDebug *dbg) |
int | match_pid (const void *pid_o, const void *th_o) |
#define TRAP_BRANCH 3 |
Definition at line 155 of file linux_debug.h.
#define TRAP_BRKPT 1 |
Definition at line 153 of file linux_debug.h.
#define TRAP_HWBKPT 4 |
Definition at line 156 of file linux_debug.h.
#define TRAP_TRACE 2 |
Definition at line 154 of file linux_debug.h.
#define TRAP_UNK 5 |
Definition at line 157 of file linux_debug.h.
RzDebugPid* fill_pid_info | ( | const char * | info, |
const char * | path, | ||
int | tid | ||
) |
Definition at line 789 of file linux_debug.c.
References rz_debug_pid_t::gid, info(), NULL, rz_debug_pid_t::path, path, rz_debug_pid_t::pc, rz_debug_pid_t::pid, rz_debug_pid_t::ppid, rz_debug_pid_t::runnable, RZ_DBG_PROC_DEAD, RZ_DBG_PROC_RUN, RZ_DBG_PROC_SLEEP, RZ_DBG_PROC_STOP, RZ_DBG_PROC_ZOMBIE, RZ_NEW0, rz_debug_pid_t::status, strdup(), and rz_debug_pid_t::uid.
Referenced by linux_add_new_thread(), linux_pid_list(), and linux_thread_list().
Definition at line 718 of file linux_debug.c.
References dbg, get_pid_thread_list(), linux_attach_single_pid(), match_pid(), pid, rz_list_find(), and rz_debug_t::threads.
Referenced by linux_attach_new_process(), and linux_select().
Definition at line 451 of file linux_debug.c.
References dbg, linux_attach(), linux_detach_all(), NULL, rz_debug_t::pid, pid, rz_debug_select(), rz_list_free(), rz_debug_t::threads, and rz_debug_t::tid.
Referenced by linux_select(), and rz_debug_continue_kill().
Definition at line 502 of file linux_debug.c.
References rz_debug_t::continue_all_threads, dbg, EINTR, eprintf, flags, linux_dbg_wait_break(), linux_dbg_wait_break_main(), linux_handle_new_task(), linux_handle_signals(), linux_ptrace_event(), linux_remove_thread(), rz_debug_t::main_pid, match_pid(), NULL, pid, rz_debug_t::reason, rz_cons_break_pop(), rz_cons_break_push(), rz_cons_context_is_main(), rz_cons_sleep_begin(), rz_cons_sleep_end(), RZ_DEBUG_REASON_DEAD, RZ_DEBUG_REASON_ERROR, RZ_DEBUG_REASON_NEW_PID, RZ_DEBUG_REASON_NONE, RZ_DEBUG_REASON_SIGNAL, RZ_DEBUG_REASON_UNKNOWN, rz_list_find(), rz_list_free(), status, rz_debug_t::threads, rz_debug_reason_t::tid, and rz_debug_reason_t::type.
Definition at line 1319 of file linux_debug.c.
References dirent::d_name, dd, desc, fail, len, memcpy(), NULL, path, pid, readdir, readlink, rz_debug_desc_free(), rz_debug_desc_new(), rz_list_append(), rz_list_free(), rz_list_newf(), RZ_LOG_ERROR, RZ_PERM_R, RZ_PERM_W, rz_strf, rz_sys_perror, stat, and type.
Definition at line 103 of file linux_debug.c.
References b, rz_debug_t::bp, rz_debug_reason_t::bp_addr, dbg, eprintf, ESRCH, rz_debug_t::glob_libs, rz_debug_t::glob_unlibs, name, p, PFMT64x, rz_debug_t::pid, rz_debug_t::reason, rz_debug_t::reg, rz_bp_get_ending_at(), rz_cons_is_breaked(), RZ_DEBUG_REASON_ABORT, RZ_DEBUG_REASON_BREAKPOINT, RZ_DEBUG_REASON_DEAD, RZ_DEBUG_REASON_EXIT_LIB, RZ_DEBUG_REASON_NEW_LIB, RZ_DEBUG_REASON_SEGFAULT, RZ_DEBUG_REASON_SIGNAL, RZ_DEBUG_REASON_STEP, RZ_DEBUG_REASON_USERSUSP, rz_debug_reg_get(), rz_debug_select(), rz_reg_get_name(), RZ_REG_NAME_A0, RZ_REG_NAME_A1, rz_str_appendf(), rz_str_startswith(), rz_sys_perror, rz_debug_reason_t::signum, rz_debug_t::stopaddr, rz_debug_t::tid, TRAP_TRACE, rz_debug_reason_t::type, and ut64().
Referenced by linux_dbg_wait().
RzDebugInfo* linux_info | ( | RzDebug * | dbg, |
const char * | arg | ||
) |
Definition at line 745 of file linux_debug.c.
References dbg, found, rz_debug_pid_t::gid, linux_thread_list(), NULL, rz_debug_t::pid, rz_debug_pid_t::pid, rdi, read_link(), RZ_DBG_PROC_STOP, rz_file_slurp(), rz_list_free(), rz_list_new(), RZ_NEW0, snprintf, rz_debug_pid_t::status, rz_debug_t::threads, rz_debug_t::tid, and rz_debug_pid_t::uid.
Definition at line 838 of file linux_debug.c.
References dirent::d_name, fill_pid_info(), i, info(), list(), NULL, path, pid, rz_debug_pid_t::ppid, procfs_pid_slurp(), readdir, RZ_DBG_PROC_STOP, rz_debug_pid_free(), rz_debug_pid_new(), rz_list_append(), rz_list_free(), and rz_sys_perror.
RzDebugReasonType linux_ptrace_event | ( | RzDebug * | dbg, |
int | pid, | ||
int | status, | ||
bool | dowait | ||
) |
Referenced by linux_dbg_wait(), and linux_handle_new_task().
char* linux_reg_profile | ( | RzDebug * | dbg | ) |
Definition at line 55 of file linux_debug.c.
References rz_debug_t::bits, rz_debug_t::bp, dbg, rz_bp_t::endian, NULL, and RZ_SYS_BITS_32.
Definition at line 1090 of file linux_debug.c.
Definition at line 1265 of file linux_debug.c.
References dbg, eprintf, false, i, NT_PRSTATUS, NULL, pid, PTRACE_POKEUSER, PTRACE_SETFPREGS, PTRACE_SETREGS, RZ_DEBUG_REG_T, rz_offsetof, RZ_REG_TYPE_DRX, RZ_REG_TYPE_FPU, RZ_REG_TYPE_GPR, rz_sys_perror, rz_debug_t::tid, type, and val.
Definition at line 444 of file linux_debug.c.
References dbg, linux_attach(), linux_attach_new_process(), rz_debug_t::pid, and pid.
Definition at line 383 of file linux_debug.c.
References dbg, pid, rz_cons_sleep_begin(), rz_cons_sleep_end(), rz_debug_t::trace_aftersyscall, rz_debug_t::trace_execs, and rz_debug_t::trace_forks.
Referenced by linux_add_new_thread(), and linux_attach_single_pid().
Definition at line 369 of file linux_debug.c.
References dbg, pid, PTRACE_SINGLESTEP, and rz_debug_t::tid.
Definition at line 660 of file linux_debug.c.
References dbg, linux_stop_thread(), rz_debug_pid_t::pid, and rz_debug_t::threads.
Definition at line 875 of file linux_debug.c.
References dirent::d_name, dbg, fill_pid_info(), i, info(), linux_attach_single_pid(), list(), MAXPID, rz_debug_t::n_threads, NULL, rz_debug_pid_t::pc, pc, pid, procfs_pid_slurp(), readdir, rz_debug_map_sync(), rz_debug_pid_free(), rz_debug_pid_new(), rz_debug_reg_get(), rz_debug_reg_sync(), rz_file_is_directory(), rz_list_append(), rz_list_free(), RZ_REG_TYPE_GPR, snprintf, rz_debug_t::tid, and ut64().
Referenced by get_pid_thread_list(), and linux_info().
Definition at line 608 of file linux_debug.c.
References rz_debug_pid_t::pid, and pid.
Referenced by linux_attach(), and linux_dbg_wait().