Rizin
unix-like reverse engineering framework and cli tools
|
Go to the source code of this file.
Macros | |
#define | CMP_CNUM_REG(x, y) ((x) >= ((RzDebugChangeReg *)y)->cnum ? 1 : -1) |
#define | CMP_CNUM_MEM(x, y) ((x) >= ((RzDebugChangeMem *)y)->cnum ? 1 : -1) |
#define | CMP_CNUM_CHKPT(x, y) ((x) >= ((RzDebugCheckpoint *)y)->cnum ? 1 : -1) |
#define | CHECK_TYPE(v, t) |
#define | SNAPATTR(ATTR) sdb_fmt("snaps.a[%u]." ATTR, i) |
#define | REGATTR(ATTR) sdb_fmt("registers.%d." ATTR, i) |
#define | SDB_LOAD(fn, ns) |
#define | DESERIALIZE(ns, func) |
#define CHECK_TYPE | ( | v, | |
t | |||
) |
Definition at line 460 of file dsession.c.
#define CMP_CNUM_CHKPT | ( | x, | |
y | |||
) | ((x) >= ((RzDebugCheckpoint *)y)->cnum ? 1 : -1) |
Definition at line 9 of file dsession.c.
#define CMP_CNUM_MEM | ( | x, | |
y | |||
) | ((x) >= ((RzDebugChangeMem *)y)->cnum ? 1 : -1) |
Definition at line 8 of file dsession.c.
#define CMP_CNUM_REG | ( | x, | |
y | |||
) | ((x) >= ((RzDebugChangeReg *)y)->cnum ? 1 : -1) |
Definition at line 7 of file dsession.c.
#define DESERIALIZE | ( | ns, | |
func | |||
) |
Definition at line 563 of file dsession.c.
#define SDB_LOAD | ( | fn, | |
ns | |||
) |
Definition at line 562 of file dsession.c.
|
static |
Definition at line 163 of file dsession.c.
References rz_debug_session_t::checkpoints, CMP_CNUM_CHKPT, NULL, rz_vector_index_ptr(), and rz_vector_upper_bound.
Referenced by rz_debug_session_restore_reg_mem().
Definition at line 158 of file dsession.c.
References _restore_memory_cb(), _set_initial_memory(), dbg, rz_debug_session_t::memory, and rz_debug_t::session.
Referenced by rz_debug_session_restore_reg_mem().
Definition at line 143 of file dsession.c.
References CMP_CNUM_MEM, rz_debug_checkpoint_t::cnum, rz_debug_session_t::cnum, rz_debug_session_t::cur_chkpt, dbg, rz_io_bind_t::io, rz_debug_t::iob, key, len, mem, rz_vector_index_ptr(), rz_vector_upper_bound, rz_debug_t::session, value, and rz_io_bind_t::write_at.
Referenced by _restore_memory().
Definition at line 126 of file dsession.c.
References _set_initial_registers(), _set_register(), rz_reg_t::allregs, dbg, and rz_debug_t::reg.
Referenced by rz_debug_session_restore_reg_mem().
|
static |
Definition at line 135 of file dsession.c.
References rz_debug_snap_t::addr, rz_debug_session_t::cur_chkpt, rz_debug_snap_t::data, dbg, rz_io_bind_t::io, rz_debug_t::iob, rz_debug_t::session, rz_debug_snap_t::size, rz_debug_checkpoint_t::snaps, and rz_io_bind_t::write_at.
Referenced by _restore_memory().
|
static |
Definition at line 100 of file dsession.c.
References a, rz_debug_checkpoint_t::arena, rz_reg_set_t::arena, b, rz_debug_session_t::cur_chkpt, dbg, i, memcpy(), rz_debug_t::reg, rz_reg_t::regset, RZ_REG_TYPE_LAST, and rz_debug_t::session.
Referenced by _restore_registers().
Definition at line 111 of file dsession.c.
References rz_reg_item_t::arena, CMP_CNUM_REG, rz_debug_checkpoint_t::cnum, rz_debug_session_t::cur_chkpt, dbg, len, NULL, rz_reg_item_t::offset, reg, rz_debug_t::reg, rz_debug_session_t::registers, rz_reg_set_value(), rz_vector_index_ptr(), rz_vector_upper_bound, and rz_debug_t::session.
Referenced by _restore_registers().
Definition at line 663 of file dsession.c.
References deserialize_checkpoints_cb(), and sdb_foreach().
Referenced by rz_debug_session_deserialize().
Definition at line 565 of file dsession.c.
References a, rz_debug_snap_t::addr, rz_debug_snap_t::addr_end, rz_debug_checkpoint_t::arena, bytes, CHECK_TYPE, rz_json_t::children, rz_debug_checkpoint_t::cnum, rz_debug_snap_t::data, test_evm::end, eprintf, free(), int, memcpy(), rz_debug_snap_t::name, rz_json_t::next, NULL, rz_json_t::num, rz_debug_snap_t::perm, rz_debug_snap_free(), RZ_JSON_ARRAY, RZ_JSON_BOOLEAN, rz_json_free(), rz_json_get(), RZ_JSON_INTEGER, RZ_JSON_OBJECT, rz_json_parse(), RZ_JSON_STRING, rz_list_append(), rz_list_newf(), RZ_NEW0, rz_reg_arena_new(), RZ_REG_TYPE_LAST, rz_vector_push(), sdb_atoi(), sdb_decode(), rz_debug_snap_t::shared, rz_debug_snap_t::size, rz_debug_checkpoint_t::snaps, rz_json_t::str_value, strdup(), rz_json_t::type, rz_debug_snap_t::user, and v.
Referenced by deserialize_checkpoints().
|
static |
Definition at line 509 of file dsession.c.
References deserialize_memory_cb(), and sdb_foreach().
Referenced by rz_debug_session_deserialize().
Definition at line 464 of file dsession.c.
References addr, CHECK_TYPE, rz_json_t::children, eprintf, free(), mem, rz_json_t::next, NULL, rz_json_t::num, RZ_JSON_ARRAY, rz_json_free(), rz_json_get(), RZ_JSON_INTEGER, RZ_JSON_OBJECT, rz_json_parse(), rz_vector_new(), rz_vector_push(), sdb_atoi(), strdup(), rz_json_t::type, ut64(), and v.
Referenced by deserialize_memory().
|
static |
Definition at line 558 of file dsession.c.
References deserialize_registers_cb(), and sdb_foreach().
Referenced by rz_debug_session_deserialize().
Definition at line 513 of file dsession.c.
References addr, CHECK_TYPE, rz_json_t::children, eprintf, free(), rz_json_t::next, NULL, rz_json_t::num, reg, RZ_JSON_ARRAY, rz_json_free(), rz_json_get(), RZ_JSON_INTEGER, RZ_JSON_OBJECT, rz_json_parse(), rz_vector_new(), rz_vector_push(), sdb_atoi(), strdup(), rz_json_t::type, ut64(), and v.
Referenced by deserialize_registers().
|
static |
Definition at line 29 of file dsession.c.
References rz_vector_free().
Referenced by rz_debug_session_new().
Definition at line 58 of file dsession.c.
References a, rz_debug_checkpoint_t::arena, rz_reg_item_t::arena, rz_reg_set_t::arena, b, rz_debug_session_t::checkpoints, rz_debug_checkpoint_t::cnum, rz_debug_session_t::cnum, dbg, i, map(), rz_debug_t::maps, rz_reg_t::name, rz_reg_item_t::offset, rz_debug_t::reg, rz_reg_t::regset, rz_debug_map_sync(), rz_debug_reg_sync(), rz_debug_session_add_reg_change(), rz_debug_snap_free(), rz_debug_snap_map(), rz_list_append(), rz_list_newf(), rz_mem_copy(), RZ_PERM_RW, rz_reg_arena_new(), rz_reg_get(), rz_reg_get_value(), RZ_REG_NAME_PC, RZ_REG_TYPE_ANY, RZ_REG_TYPE_GPR, RZ_REG_TYPE_LAST, rz_return_val_if_fail, rz_vector_push(), rz_debug_t::session, rz_debug_checkpoint_t::snaps, and ut64().
Referenced by rz_cmd_debug_start_trace_session_handler(), and rz_debug_continue_kill().
|
static |
Definition at line 20 of file dsession.c.
References rz_debug_checkpoint_t::arena, i, rz_list_free(), rz_reg_arena_free(), RZ_REG_TYPE_LAST, and rz_debug_checkpoint_t::snaps.
Referenced by rz_debug_session_new().
RZ_API bool rz_debug_session_add_mem_change | ( | RzDebugSession * | session, |
ut64 | addr, | ||
ut8 | data | ||
) |
Definition at line 233 of file dsession.c.
References addr, rz_debug_session_t::cnum, eprintf, mem, rz_debug_session_t::memory, NULL, rz_vector_new(), and rz_vector_push().
Referenced by rz_debug_trace_ins_after().
RZ_API bool rz_debug_session_add_reg_change | ( | RzDebugSession * | session, |
int | arena, | ||
ut64 | offset, | ||
ut64 | data | ||
) |
Definition at line 218 of file dsession.c.
References rz_debug_session_t::cnum, eprintf, NULL, reg, rz_debug_session_t::registers, rz_vector_new(), and rz_vector_push().
Referenced by rz_debug_add_checkpoint(), and rz_debug_trace_ins_after().
RZ_API void rz_debug_session_deserialize | ( | RzDebugSession * | session, |
Sdb * | db | ||
) |
Definition at line 707 of file dsession.c.
References rz_debug_session_t::checkpoints, DESERIALIZE, deserialize_checkpoints(), deserialize_memory(), deserialize_registers(), rz_debug_session_t::maxcnum, rz_debug_session_t::memory, rz_debug_session_t::registers, and sdb_num_get().
Referenced by rz_debug_session_load().
RZ_API void rz_debug_session_free | ( | RzDebugSession * | session | ) |
Definition at line 11 of file dsession.c.
References rz_debug_session_t::checkpoints, rz_debug_session_t::memory, rz_debug_session_t::registers, RZ_FREE, and rz_vector_free().
Referenced by rz_cmd_debug_load_trace_session_handler(), rz_cmd_debug_stop_trace_session_handler(), rz_core_debug_process_close(), rz_debug_free(), and rz_debug_session_new().
Definition at line 185 of file dsession.c.
References rz_debug_t::cb_printf, dbg, free(), map(), rz_debug_t::maps, rz_debug_snap_t::name, rz_debug_map_sync(), rz_debug_snap_free(), rz_debug_snap_get_hash(), rz_debug_snap_map(), rz_hex_bin2strdup(), and RZ_PERM_RW.
Referenced by rz_cmd_debug_list_trace_session_mmap_handler().
Definition at line 727 of file dsession.c.
References dbg, path, rz_debug_session_deserialize(), rz_debug_session_restore_reg_mem(), sdb_free(), rz_debug_t::session, and session_sdb_load().
Referenced by rz_cmd_debug_load_trace_session_handler().
RZ_API RzDebugSession* rz_debug_session_new | ( | void | ) |
Definition at line 33 of file dsession.c.
References rz_debug_session_t::checkpoints, htup_vector_free(), rz_debug_session_t::memory, NULL, rz_debug_session_t::registers, rz_debug_checkpoint_fini(), rz_debug_session_free(), RZ_NEW0, and rz_vector_new().
Referenced by rz_cmd_debug_load_trace_session_handler(), and rz_cmd_debug_start_trace_session_handler().
Definition at line 173 of file dsession.c.
References _get_checkpoint_before(), _restore_memory(), _restore_registers(), rz_debug_session_t::cur_chkpt, dbg, rz_debug_reg_sync(), RZ_REG_TYPE_ANY, and rz_debug_t::session.
Referenced by rz_debug_goto_cnum(), and rz_debug_session_load().
RZ_API bool rz_debug_session_save | ( | RzDebugSession * | session, |
const char * | path | ||
) |
Definition at line 445 of file dsession.c.
References path, rz_debug_session_serialize(), sdb_free(), sdb_new0(), and session_sdb_save().
Referenced by rz_cmd_debug_save_trace_session_handler().
RZ_API void rz_debug_session_serialize | ( | RzDebugSession * | session, |
Sdb * | db | ||
) |
Definition at line 402 of file dsession.c.
References rz_debug_session_t::checkpoints, rz_debug_session_t::maxcnum, rz_debug_session_t::memory, rz_debug_session_t::registers, sdb_ns(), sdb_num_set(), serialize_checkpoints(), serialize_memory(), and serialize_registers().
Referenced by rz_debug_session_save().
Definition at line 304 of file dsession.c.
References rz_debug_snap_t::addr, rz_debug_snap_t::addr_end, rz_debug_checkpoint_t::arena, rz_reg_arena_t::bytes, rz_debug_checkpoint_t::cnum, rz_debug_snap_t::data, free(), i, rz_debug_snap_t::name, rz_debug_snap_t::perm, pj_end(), pj_free(), pj_ka(), pj_kb(), pj_kn(), pj_ks(), pj_new(), pj_o(), pj_string(), RZ_REG_TYPE_LAST, rz_vector_foreach, sdb_encode(), sdb_fmt(), sdb_set(), rz_debug_snap_t::shared, rz_debug_snap_t::size, rz_reg_arena_t::size, rz_debug_checkpoint_t::snaps, and rz_debug_snap_t::user.
Referenced by rz_debug_session_serialize().
|
static |
Definition at line 300 of file dsession.c.
References serialize_memory_cb().
Referenced by rz_debug_session_serialize().
Definition at line 278 of file dsession.c.
References k, mem, PFMT64x, pj_a(), pj_end(), pj_free(), pj_kN(), pj_kn(), pj_new(), pj_o(), pj_string(), rz_vector_foreach, sdb_fmt(), sdb_set(), and v.
Referenced by serialize_memory().
Definition at line 251 of file dsession.c.
References k, PFMT64x, pj_a(), pj_end(), pj_free(), pj_kN(), pj_kn(), pj_new(), pj_o(), pj_string(), reg, rz_vector_foreach, sdb_fmt(), sdb_set(), and v.
Referenced by serialize_registers().
|
static |
Definition at line 273 of file dsession.c.
References serialize_register_cb().
Referenced by rz_debug_session_serialize().
Definition at line 680 of file dsession.c.
References error(), NULL, sdb_free(), SDB_LOAD, and sdb_new0().
Referenced by rz_debug_session_load().
Definition at line 667 of file dsession.c.
References eprintf, sdb_copy(), sdb_free(), sdb_new0(), sdb_ns_path(), and sdb_open().
Definition at line 409 of file dsession.c.
References eprintf, free(), ls_foreach, sdb_ns_t::name, sdb_t::ns, path, rz_file_is_directory(), rz_str_newf(), RZ_SYS_DIR, sdb_ns_t::sdb, sdb_close(), sdb_file(), and sdb_sync().
Referenced by rz_debug_session_save().