Rizin
unix-like reverse engineering framework and cli tools
|
Go to the source code of this file.
Variables | |
static struct rz_bp_plugin_t * | bp_static_plugins [] = { RZ_BP_STATIC_PLUGINS } |
|
inlinestatic |
|
inlinestatic |
|
static |
Definition at line 218 of file bp.c.
References addr, b, rz_bp_t::baddr, rz_bp_t::bpinmaps, calloc(), err, malloc(), memcpy(), NULL, rz_bp_get_bytes(), rz_bp_get_in(), rz_bp_is_valid(), rz_bp_item_free(), rz_bp_item_insert(), RZ_LOG_ERROR, RZ_LOG_WARN, RZ_NEW0, and UT64_MAX.
Referenced by rz_bp_add_hw(), and rz_bp_add_sw().
RZ_API RzBreakpointItem* rz_bp_add_hw | ( | RzBreakpoint * | bp, |
ut64 | addr, | ||
int | size, | ||
int | perm | ||
) |
Definition at line 299 of file bp.c.
References addr, NULL, rz_bp_add(), and RZ_BP_TYPE_HW.
Referenced by rz_debug_bp_add().
RZ_API RZ_BORROW RzBreakpointItem* rz_bp_add_sw | ( | RZ_NONNULL RzBreakpoint * | bp, |
ut64 | addr, | ||
int | size, | ||
int | perm | ||
) |
Add a software breakpoint size
preferred size of the breakpoint, or 0 to determine automatically.
Definition at line 280 of file bp.c.
References addr, bytes, calloc(), free(), memset(), NULL, rz_bp_add(), rz_bp_size_at(), RZ_BP_TYPE_SW, and rz_return_val_if_fail.
Referenced by rz_core_debug_continue_until(), rz_debug_bp_add(), rz_debug_continue_until_internal(), rz_debug_execute(), and rz_debug_step_soft().
RZ_API bool rz_bp_del | ( | RzBreakpoint * | bp, |
ut64 | addr | ||
) |
Definition at line 315 of file bp.c.
References addr, b, rz_bp_t::bps, and unlinkBreakpoint().
Referenced by __cursor_del_breakpoints(), debug_trace_calls(), rz_cmd_debug_remove_bp_handler(), rz_core_debug_breakpoint_toggle(), rz_core_debug_continue_until(), rz_core_debug_step_over(), rz_debug_continue_until_internal(), rz_debug_execute(), and rz_debug_step_soft().
RZ_API bool rz_bp_del_all | ( | RzBreakpoint * | bp | ) |
Definition at line 303 of file bp.c.
References rz_bp_t::bps, rz_bp_t::bps_idx, rz_bp_t::bps_idx_count, i, NULL, and rz_list_purge().
Referenced by rz_cmd_debug_remove_all_bp_handler(), and rz_serialize_bp_load().
RZ_API int rz_bp_del_index | ( | RzBreakpoint * | bp, |
int | idx | ||
) |
Definition at line 364 of file bp.c.
References rz_bp_t::bps, rz_bp_t::bps_idx, setup::idx, and rz_list_delete_data().
Referenced by rz_cmd_debug_remove_bp_index_handler().
RZ_API RzBreakpointItem* rz_bp_enable | ( | RzBreakpoint * | bp, |
ut64 | addr, | ||
int | set, | ||
int | count | ||
) |
Definition at line 152 of file bp.c.
References addr, b, count, NULL, and rz_bp_get_in().
Referenced by rz_cmd_debug_disable_bp_handler(), rz_cmd_debug_enable_bp_handler(), and rz_core_debug_breakpoint_toggle().
RZ_API bool rz_bp_enable_all | ( | RzBreakpoint * | bp, |
int | set | ||
) |
RZ_API RzBreakpoint* rz_bp_free | ( | RzBreakpoint * | bp | ) |
Definition at line 48 of file bp.c.
References rz_bp_t::bps, rz_bp_t::bps_idx, free(), NULL, rz_bp_t::plugins, rz_list_free(), and rz_bp_t::traces.
Referenced by rz_debug_free().
RZ_API RZ_BORROW RzBreakpointItem* rz_bp_get_at | ( | RZ_NONNULL RzBreakpoint * | bp, |
ut64 | addr | ||
) |
Get the breakpoint at exactly addr
.
Definition at line 102 of file bp.c.
References addr, b, NULL, and rz_return_val_if_fail.
Referenced by ds_print_show_cursor(), rz_cmd_debug_add_cond_bp_handler(), rz_cmd_debug_bp_set_expr_cur_offset_handler(), rz_cmd_debug_command_bp_handler(), rz_cmd_debug_name_bp_handler(), rz_cmd_debug_show_cur_bp_handler(), rz_core_debug_breakpoint_toggle(), rz_core_debug_step_over(), rz_core_debug_step_skip(), rz_core_esil_step(), rz_debug_bp_hit(), rz_debug_continue_until_internal(), and w32_dbg_wait().
RZ_API int rz_bp_get_bytes | ( | RZ_NONNULL RzBreakpoint * | bp, |
ut64 | addr, | ||
RZ_NONNULL ut8 * | buf, | ||
int | len | ||
) |
Get the bytes to place at addr
in order to set a sw breakpoint there return
the length of bytes or 0 on failure
Definition at line 61 of file bp.c.
References addr, b, bits(), rz_bp_arch_t::endian, i, len, memcpy(), repeat(), RZ_LOG_ERROR, and rz_return_val_if_fail.
Referenced by rz_bp_add(), and rz_bp_traptrace_add().
RZ_API RZ_BORROW RzBreakpointItem* rz_bp_get_ending_at | ( | RZ_NONNULL RzBreakpoint * | bp, |
ut64 | addr | ||
) |
Get the breakpoint b that fulfills b->addr + b-> size == addr
After hitting a (usually software) breakpoint, the program counter will be directly after it. This way we can trace back the breakpoint matching this program counter.
Definition at line 119 of file bp.c.
References addr, b, NULL, and rz_return_val_if_fail.
Referenced by linux_handle_signals(), and rz_debug_bp_hit().
RZ_API RzBreakpointItem* rz_bp_get_in | ( | RzBreakpoint * | bp, |
ut64 | addr, | ||
int | perm | ||
) |
Definition at line 139 of file bp.c.
References addr, b, rz_bp_t::bps, inRange(), matchProt(), and NULL.
Referenced by rz_bp_add(), rz_bp_enable(), rz_bp_set_trace(), rz_bp_watch_add(), rz_cmd_debug_bt_toggle_bp_trace_handler(), rz_core_esil_continue_back(), rz_debug_continue_back(), rz_debug_continue_kill(), and rz_debug_continue_until_internal().
RZ_API RzBreakpointItem* rz_bp_get_index | ( | RzBreakpoint * | bp, |
int | idx | ||
) |
Definition at line 347 of file bp.c.
References rz_bp_t::bps_idx, setup::idx, and NULL.
Referenced by rz_cmd_debug_disable_bp_index_handler(), rz_cmd_debug_disable_bp_trace_index_handler(), rz_cmd_debug_enable_bp_index_handler(), rz_cmd_debug_enable_bp_trace_index_handler(), rz_cmd_debug_run_command_bp_index_handler(), rz_cmd_debug_set_expr_bp_index_handler(), rz_cmd_debug_toggle_bp_index_handler(), and rz_cmd_debug_toggle_bp_trace_index_handler().
RZ_API int rz_bp_get_index_at | ( | RzBreakpoint * | bp, |
ut64 | addr | ||
) |
Definition at line 354 of file bp.c.
References addr, rz_bp_item_t::addr, rz_bp_t::bps_idx, rz_bp_t::bps_idx_count, and i.
Referenced by linux_remove_fork_bps(), and rz_cmd_debug_show_bp_index_handler().
RZ_API bool rz_bp_is_valid | ( | RzBreakpoint * | bp, |
RzBreakpointItem * | b | ||
) |
Definition at line 406 of file bp.c.
References b, rz_bp_t::bpinmaps, rz_bp_t::ctx, rz_bp_context_t::is_mapped, and rz_bp_context_t::user.
Referenced by rz_bp_add(), rz_bp_restore_except(), and rz_cmd_debug_list_bp_handler().
|
static |
RZ_IPI void rz_bp_item_insert | ( | RzBreakpoint * | bp, |
RzBreakpointItem * | b | ||
) |
Put an allocated RzBreakpointItem into the RzBreakpoint's list and give it an index
Definition at line 189 of file bp.c.
References b, rz_bp_t::bps, rz_bp_t::bps_idx, rz_bp_t::bps_idx_count, i, rz_bp_t::nbps, NULL, realloc(), and rz_list_append().
Referenced by rz_bp_add(), and rz_bp_watch_add().
RZ_API bool rz_bp_item_set_cond | ( | RZ_NONNULL RzBreakpointItem * | item, |
RZ_NULLABLE const char * | cond | ||
) |
set the condition for a RzBreakpointItem
item | brekapoint item to set value for |
cond | value of cond to be set; if NULL is passed, then the cond value of item will be set to NULL |
item
will not have been modified Definition at line 423 of file bp.c.
References cond, free(), NULL, rz_return_val_if_fail, and strdup().
Referenced by rz_cmd_debug_add_cond_bp_handler().
RZ_API bool rz_bp_item_set_data | ( | RZ_NONNULL RzBreakpointItem * | item, |
RZ_NULLABLE const char * | data | ||
) |
set the data for a RzBreakpointItem
item | brekapoint item to set value for |
data | value of data to be set; if NULL is passed, then the data value of item will be set to NULL |
item
will not have been modified Definition at line 445 of file bp.c.
References free(), NULL, rz_return_val_if_fail, and strdup().
Referenced by rz_cmd_debug_command_bp_handler(), and rz_cmd_debug_run_command_bp_index_handler().
RZ_API bool rz_bp_item_set_expr | ( | RZ_NONNULL RzBreakpointItem * | item, |
RZ_NULLABLE const char * | expr | ||
) |
set the expr for a RzBreakpointItem
item | brekapoint item to set value for |
expr | value of expr to be set; if NULL is passed, then the expr value of item will be set to NULL |
item
will not have been modified Definition at line 467 of file bp.c.
References expr(), free(), NULL, rz_return_val_if_fail, and strdup().
Referenced by rz_cmd_debug_bp_set_expr_cur_offset_handler(), and rz_cmd_debug_set_expr_bp_index_handler().
RZ_API bool rz_bp_item_set_name | ( | RZ_NONNULL RzBreakpointItem * | item, |
RZ_NULLABLE const char * | name | ||
) |
set the name for a RzBreakpointItem
item | brekapoint item to set value for |
name | value of name to be set; if NULL is passed, then the name value of item will be set to NULL |
item
will not have been modified Definition at line 489 of file bp.c.
References free(), NULL, rz_return_val_if_fail, and strdup().
Referenced by rz_cmd_debug_name_bp_handler(), rz_core_debug_bp_add(), and rz_core_debug_bp_add_noreturn_func().
RZ_API RzBreakpoint* rz_bp_new | ( | RZ_BORROW RZ_NONNULL RzBreakpointContext * | ctx | ) |
Construct a new RzBreakpoint instance
ctx | global context in which the instance will operate (giving mappings, etc) |
Definition at line 26 of file bp.c.
References bp_static_plugins, rz_bp_t::bps, rz_bp_t::bps_idx, rz_bp_t::bps_idx_count, rz_bp_t::cb_printf, rz_bp_t::ctx, free(), i, rz_bp_t::iob, memset(), rz_bp_t::nhwbps, NULL, rz_bp_t::plugins, printf(), RZ_ARRAY_SIZE, RZ_BP_CONT_NORMAL, rz_bp_item_free(), rz_bp_plugin_add(), rz_bp_traptrace_new(), rz_list_newf(), RZ_NEW0, RZ_NEWS0, rz_bp_t::stepcont, and rz_bp_t::traces.
Referenced by rz_debug_new().
RZ_API int rz_bp_set_trace | ( | RzBreakpoint * | bp, |
ut64 | addr, | ||
int | set | ||
) |
Definition at line 329 of file bp.c.
References addr, b, and rz_bp_get_in().
Referenced by rz_cmd_debug_bt_disable_bp_trace_handler(), and rz_cmd_debug_bt_enable_bp_trace_handler().
RZ_API int rz_bp_set_trace_all | ( | RzBreakpoint * | bp, |
int | set | ||
) |
RZ_API int rz_bp_size | ( | RZ_NONNULL RzBreakpoint * | bp, |
int | bits | ||
) |
Predict the software breakpoint size to use for the given arch-bitness.
bits | bitness or 0 if unspecified |
Definition at line 377 of file bp.c.
References rz_bp_arch_t::bits, bits(), i, rz_bp_arch_t::length, and rz_return_val_if_fail.
Referenced by rz_bp_size_at().
RZ_API int rz_bp_size_at | ( | RZ_NONNULL RzBreakpoint * | bp, |
ut64 | addr | ||
) |
Predict the software breakpoint size to use when placing a breakpoint at addr
.
Definition at line 399 of file bp.c.
References addr, bits(), rz_bp_size(), and rz_return_val_if_fail.
Referenced by rz_bp_add_sw(), and rz_debug_bp_add().
RZ_API int rz_bp_stepy_continuation | ( | RzBreakpoint * | bp | ) |
Definition at line 171 of file bp.c.
References rz_bp_t::stepcont.
RZ_LIB_VERSION | ( | rz_bp | ) |
|
static |
Definition at line 176 of file bp.c.
References b, rz_bp_t::bps, rz_bp_t::bps_idx, rz_bp_t::bps_idx_count, i, NULL, and rz_list_delete_data().
Referenced by rz_bp_del().
|
static |
Definition at line 9 of file bp.c.
Referenced by rz_bp_new().