Rizin
unix-like reverse engineering framework and cli tools
|
Go to the source code of this file.
Macros | |
#define | SIGKILL 9 |
#define SIGKILL 9 |
Definition at line 437 of file cdebug.c.
References rz_core_t::flags, free(), map(), maps(), PFMT64x, rz_cons_printf(), rz_flag_set_next(), rz_name_filter(), rz_str_newf(), rz_str_rwx_i(), and ut64().
Referenced by rz_core_debug_map_print(), and rz_core_debug_map_update_flags().
Definition at line 530 of file cdebug.c.
References a, rz_debug_map_t::addr, and b.
Referenced by print_debug_maps_ascii_art().
Find the min and max addresses in an RzList of maps.
maps | RzList of maps that will be searched through |
min | Pointer to a ut64 that the min will be stored in |
max | Pointer to a ut64 that the max will be stored in |
skip | How many maps to skip at the start of iteration |
width | Divisor for the return value |
Used to determine the min & max addresses of maps and scale the ascii bar to the width of the terminal
Definition at line 548 of file cdebug.c.
References map(), maps(), max, min, skip(), UT64_MAX, and width.
Referenced by print_debug_maps_ascii_art().
|
static |
Definition at line 866 of file cdebug.c.
References addr, rz_debug_frame_t::addr, rz_debug_t::bits, rz_core_t::dbg, delta, f, rz_core_t::flags, free(), int, NULL, PFMT64x, rz_flag_get_at(), rz_str_cmp(), rz_str_newf(), RZ_SYS_BITS_32, RZ_SYS_BITS_64, and rz_debug_frame_t::sp.
Referenced by rz_core_debug_backtraces().
Definition at line 17 of file cdebug.c.
References addr, dbg, rz_io_bind_t::io, rz_debug_t::iob, rz_io_bind_t::read_at, and RZ_ARRAY_SIZE.
Referenced by rz_core_debug_continue_until().
Definition at line 41 of file cdebug.c.
References addr, dbg, rz_io_bind_t::io, rz_debug_t::iob, rz_io_bind_t::read_at, and RZ_ARRAY_SIZE.
Referenced by rz_core_debug_continue_until().
|
static |
Definition at line 371 of file cdebug.c.
References map(), pj_end(), pj_kn(), pj_ks(), pj_o(), and rz_str_rwx_i().
Referenced by rz_core_debug_map_print().
|
static |
Definition at line 387 of file cdebug.c.
References addr, rz_debug_t::bits, rz_core_bind_t::core, rz_debug_t::corebind, dbg, free(), rz_core_bind_t::getName, map(), NULL, PFMT64x, rz_cons_printf(), rz_name_filter(), rz_num_units(), RZ_OUTPUT_MODE_QUIET, rz_str_newf(), rz_str_rwx_i(), RZ_SYS_BITS_64, strdup(), and type.
Referenced by rz_core_debug_map_print().
|
static |
Definition at line 568 of file cdebug.c.
References addr, rz_debug_t::bits, cmp(), Color_RESET, colors, rz_cons_t::context, dbg, findMinMax(), rz_cons_printable_palette_t::graph_false, rz_cons_printable_palette_t::graph_true, map(), maps(), max, min, mul(), NULL, rz_cons_context_t::pal, PFMT64x, pos, rz_cons_get_size(), rz_cons_printf(), rz_cons_singleton(), rz_list_sort(), rz_num_units(), rz_str_rwx_i(), RZ_SYS_BITS_64, skip(), UT32_MAX, ut64(), rz_cons_printable_palette_t::widget_sel, and width.
Referenced by rz_debug_map_list_visual().
RZ_API void rz_backtrace_free | ( | RZ_NULLABLE RzBacktrace * | bt | ) |
Definition at line 284 of file cdebug.c.
References rz_debug_plugin_t::canstep, rz_core_t::config, rz_debug_t::cur, rz_core_t::dbg, rz_core_file_t::fd, rz_core_t::file, rz_core_t::io, rz_debug_t::pid, pid, rz_config_set_i(), rz_debug_attach(), rz_debug_reg_profile_sync(), rz_debug_select(), rz_io_fd_get_pid(), rz_io_system(), rz_strf, and rz_debug_t::tid.
Referenced by cmd_debug_pid(), and rz_core_setup_debugger().
Get backtraces based on dbg.btdepth and dbg.btalgo.
core | The RzCore instance |
Definition at line 926 of file cdebug.c.
References rz_debug_frame_t::addr, rz_core_t::analysis, rz_core_t::dbg, rz_backtrace_t::desc, rz_backtrace_t::fcn, rz_backtrace_t::flagdesc, rz_backtrace_t::flagdesc2, rz_backtrace_t::frame, get_backtrace_info(), list(), NULL, rz_backtrace_t::pcstr, rz_analysis_get_fcn_in(), rz_backtrace_free(), rz_debug_frames(), rz_list_append(), rz_list_free(), rz_list_newf(), RZ_NEW0, RZ_NEWCOPY, rz_str_get_null(), rz_str_newf(), rz_backtrace_t::spstr, and UT64_MAX.
Referenced by rz_cmd_debug_display_bt_handler().
Put a breakpoint into every no-return function.
core | Current RzCore instance |
Definition at line 256 of file cdebug.c.
References rz_core_t::analysis, rz_core_t::bin, rz_core_t::config, rz_core_t::dbg, free(), rz_bin_symbol_t::name, NULL, PFMT64x, rz_analysis_noreturn_at(), rz_bin_get_symbols(), RZ_BIN_TYPE_FUNC_STR, rz_bp_item_set_name(), rz_config_get_i(), rz_debug_bp_add(), RZ_LOG_ERROR, rz_str_newf(), symbols(), rz_bin_symbol_t::type, and rz_bin_symbol_t::vaddr.
Referenced by rz_cmd_debug_add_bp_noreturn_func_handler().
RZ_API void rz_core_debug_breakpoint_toggle | ( | RZ_NONNULL RzCore * | core, |
ut64 | addr | ||
) |
Toggle breakpoint.
core | RzCore instance |
addr | Breakpoint addr |
Definition at line 235 of file cdebug.c.
References addr, eprintf, int, NULL, PFMT64x, rz_bp_del(), rz_bp_enable(), rz_bp_get_at(), rz_config_get_i(), rz_debug_bp_add(), and rz_return_if_fail.
Referenced by __break_points_cb(), __panel_breakpoint(), __set_breakpoints_on_cursor(), graph_breakpoint(), rz_cmd_debug_toggle_bp_handler(), rz_core_visual_cmd(), and visual_breakpoint().
Definition at line 81 of file cdebug.c.
References rz_debug_t::continue_all_threads, rz_core_t::dbg, NULL, rz_debug_t::reg, rz_cons_break_pop(), rz_cons_break_push(), rz_core_dbg_follow_seek_register(), rz_core_esil_step(), rz_core_is_debug(), rz_core_reg_update_flags(), rz_core_static_debug_stop(), rz_debug_continue(), rz_reg_arena_swap(), and UT64_MAX.
Referenced by __continue_cb(), __panels_process(), graph_continue(), rz_cmd_debug_continue_execution_handler(), and visual_nkey().
Definition at line 98 of file cdebug.c.
References addr, rz_debug_frame_t::addr, rz_debug_t::arch, rz_debug_t::bits, rz_debug_frame_t::bp, rz_debug_t::bp, rz_debug_t::btalgo, rz_debug_t::call_frames, rz_core_t::dbg, eprintf, rz_list_t::free, free(), test-lz4-versions::head, rz_io_bind_t::io, rz_debug_t::iob, is_x86_call(), is_x86_ret(), level, rz_reg_t::name, NULL, pc, PFMT32x, PFMT64x, rz_io_bind_t::read_at, rz_debug_t::reg, rz_bp_add_sw(), rz_bp_del(), rz_cons_break_pop(), rz_cons_break_push(), rz_cons_is_breaked(), rz_core_reg_update_flags(), rz_debug_continue(), rz_debug_is_dead(), rz_debug_reg_get(), rz_debug_reg_sync(), rz_debug_step(), rz_list_free(), rz_list_get_bottom(), rz_list_new(), rz_list_pop_head(), rz_list_prepend(), RZ_LOG_ERROR, RZ_NEW0, RZ_PERM_X, rz_reg_arena_swap(), RZ_REG_NAME_PC, RZ_REG_NAME_SP, RZ_REG_TYPE_GPR, rz_debug_frame_t::size, rz_debug_frame_t::sp, ut64(), and UT64_MAX.
Referenced by cmd_dcu(), rz_core_debug_single_step_in(), rz_core_setup_debugger(), and visual_nkey().
RZ_API void rz_core_debug_map_print | ( | RzCore * | core, |
ut64 | addr, | ||
RzCmdStateOutput * | state | ||
) |
Definition at line 481 of file cdebug.c.
References addr, apply_maps_as_flags(), dbg, rz_core_t::dbg, i, map(), maps(), print_debug_map_json(), print_debug_map_line(), rz_cmd_state_output_array_end(), rz_cmd_state_output_array_start(), rz_debug_map_list(), RZ_FLAGS_FS_DEBUG_MAPS, RZ_OUTPUT_MODE_JSON, RZ_OUTPUT_MODE_LONG, RZ_OUTPUT_MODE_QUIET, RZ_OUTPUT_MODE_RIZIN, and rz_return_if_fail.
Referenced by rz_cmd_debug_list_maps_handler(), and rz_cmd_debug_map_current_handler().
Create or update flags for all current debug maps in the "maps" flagspace
Definition at line 462 of file cdebug.c.
References apply_maps_as_flags(), rz_core_t::dbg, rz_core_t::flags, maps(), rz_debug_is_dead(), rz_debug_map_list(), rz_debug_map_sync(), rz_flag_unset_all_in_space(), RZ_FLAGS_FS_DEBUG_MAPS, and rz_return_if_fail.
Referenced by rz_core_file_reopen(), and rz_main_rizin().
RZ_API RzCmdStatus rz_core_debug_plugin_print | ( | RzDebug * | dbg, |
RzDebugPlugin * | plugin, | ||
RzCmdStateOutput * | state, | ||
int | count, | ||
char * | spaces | ||
) |
Definition at line 300 of file cdebug.c.
References rz_debug_plugin_t::arch, count, rz_debug_t::cur, dbg, rz_debug_plugin_t::license, rz_debug_plugin_t::name, pj_end(), pj_ks(), pj_o(), RZ_CMD_STATUS_NONEXISTINGCMD, RZ_CMD_STATUS_OK, rz_cons_printf(), RZ_OUTPUT_MODE_JSON, RZ_OUTPUT_MODE_QUIET, RZ_OUTPUT_MODE_STANDARD, rz_warn_if_reached, and spaces().
Referenced by rz_core_debug_plugins_print().
RZ_API RzCmdStatus rz_core_debug_plugins_print | ( | RzCore * | core, |
RzCmdStateOutput * | state | ||
) |
Definition at line 329 of file cdebug.c.
References count, dbg, rz_core_t::dbg, memset(), rz_debug_plugin_t::name, rz_debug_t::plugins, rz_cmd_state_output_array_end(), rz_cmd_state_output_array_start(), RZ_CMD_STATUS_ERROR, RZ_CMD_STATUS_OK, rz_core_debug_plugin_print(), sp, spaces(), and status.
Referenced by cb_dbgbackend(), rz_cmd_debug_handler_list_handler(), rz_main_rizin(), and rz_plugins_debug_print_handler().
Definition at line 356 of file cdebug.c.
References rz_core_t::offset, reg, rz_cons_flush(), rz_core_print_disasm_instructions(), rz_core_reg_default(), rz_core_reg_print_diff(), rz_core_seek(), rz_list_free(), rz_reg_filter_items_covered(), rz_reg_get_value_by_role(), RZ_REG_NAME_PC, and ut64().
Referenced by rz_core_prompt_loop().
Close debug process (Kill debugee and all child processes)
core | The RzCore instance |
Definition at line 707 of file cdebug.c.
References rz_debug_t::cur, dbg, rz_core_t::dbg, rz_io_t::desc, rz_io_desc_t::fd, rz_core_t::io, list(), NULL, p, rz_debug_t::pid, rz_debug_plugin_t::pids, rz_core_debug_clear_register_flags(), rz_core_io_file_open(), rz_debug_detach(), rz_debug_kill(), rz_debug_session_free(), rz_return_val_if_fail, rz_debug_t::session, and SIGKILL.
Referenced by rz_cmd_debug_process_close_handler().
Definition at line 193 of file cdebug.c.
References rz_print_t::cur, rz_print_t::cur_enabled, NULL, rz_core_t::offset, rz_core_t::print, rz_core_debug_continue_until(), rz_core_debug_step_one(), rz_core_esil_step(), rz_core_is_debug(), rz_core_reg_update_flags(), and UT64_MAX.
Referenced by __panel_single_step_in(), graph_single_step_in(), rz_core_visual_cmd(), and visual_nkey().
Definition at line 207 of file cdebug.c.
References rz_core_t::config, rz_print_t::cur_enabled, rz_core_t::dbg, rz_core_t::print, rz_debug_t::reg, RZ_ANALYSIS_OP_TYPE_RET, rz_config_get_b(), rz_config_set_b(), rz_cons_break_pop(), rz_cons_break_push(), rz_core_analysis_esil_step_over(), rz_core_dbg_follow_seek_register(), rz_core_debug_step_over(), rz_core_is_debug(), rz_core_reg_update_flags(), rz_core_static_debug_stop(), rz_debug_continue_until_optype(), and rz_reg_arena_swap().
Referenced by __panel_single_step_over(), graph_single_step_over(), rz_core_visual_cmd(), and visual_nkey().
Step back.
core | The RzCore instance |
steps | Step steps |
Definition at line 777 of file cdebug.c.
References rz_core_t::dbg, rz_core_esil_step_back(), rz_core_is_debug(), rz_core_reg_update_flags(), rz_debug_step_back(), RZ_LOG_ERROR, and rz_debug_t::session.
Referenced by rz_cmd_debug_step_back_handler().
Definition at line 56 of file cdebug.c.
References rz_core_t::break_loop, rz_core_t::dbg, eprintf, i, NULL, pc, rz_debug_t::reg, rz_core_esil_step(), rz_core_is_debug(), rz_core_reg_update_flags(), rz_debug_reg_get(), rz_debug_reg_sync(), rz_debug_step(), rz_debug_trace_pc(), rz_reg_arena_swap(), RZ_REG_TYPE_GPR, times, ut64(), and UT64_MAX.
Referenced by loadGP(), rz_cmd_debug_step_handler(), and rz_core_debug_single_step_in().
Step over.
core | The RzCore instance |
steps | Step steps |
Definition at line 802 of file cdebug.c.
References addr, rz_debug_t::bp, rz_core_t::config, rz_core_t::dbg, i, NULL, rz_debug_t::reg, rz_bp_del(), rz_bp_get_at(), rz_config_get_b(), rz_config_get_i(), rz_core_analysis_esil_step_over(), rz_core_debug_step_skip(), rz_core_is_debug(), rz_core_reg_update_flags(), rz_debug_bp_add(), rz_debug_reg_get(), rz_debug_step_over(), rz_reg_arena_swap(), and ut64().
Referenced by rz_cmd_debug_step_over_handler(), and rz_core_debug_single_step_over().
Skip operations.
core | The RzCore instance |
times | Skip op times |
Definition at line 831 of file cdebug.c.
References addr, rz_core_t::analysis, rz_debug_t::bp, rz_core_t::config, rz_core_t::dbg, i, rz_core_t::io, NULL, rz_analysis_t::reg, rz_debug_t::reg, rz_analysis_op(), RZ_ANALYSIS_OP_MASK_BASIC, rz_bp_get_at(), rz_config_get_b(), rz_core_reg_update_flags(), rz_debug_bp_add(), rz_debug_reg_get(), rz_debug_reg_set(), rz_debug_reg_sync(), rz_io_read_at(), rz_reg_arena_swap(), rz_reg_setv(), RZ_REG_TYPE_GPR, rz_analysis_op_t::size, times, and ut64().
Referenced by rz_cmd_debug_step_skip_handler(), and rz_core_debug_step_over().
Step until end of frame.
core | The RzCore instance |
Definition at line 745 of file cdebug.c.
References rz_core_t::dbg, NULL, off, rz_cons_break_pop(), rz_cons_break_push(), rz_cons_is_breaked(), rz_core_reg_update_flags(), rz_debug_is_dead(), rz_debug_reg_get(), rz_debug_step_over(), RZ_LOG_INFO, rz_return_val_if_fail, and ut64().
Referenced by rz_cmd_debug_step_frame_handler().
Definition at line 184 of file cdebug.c.
References rz_debug_t::bits, rz_core_t::config, rz_core_t::dbg, rz_config_get_i(), rz_config_set_i(), rz_core_is_debug(), and ut64().
Referenced by rz_core_dbg_follow_seek_register(), and rz_core_visual_title().
Check whether the core is in debug mode (equivalent to cfg.debug)
Definition at line 13 of file cdebug.c.
References rz_core_t::bin, and rz_bin_t::is_debugger.
Referenced by bp_is_mapped(), bp_maps_sync(), rz_core_analysis_address(), rz_core_arg_get(), rz_core_debug_continue(), rz_core_debug_single_step_in(), rz_core_debug_single_step_over(), rz_core_debug_step_back(), rz_core_debug_step_one(), rz_core_debug_step_over(), rz_core_debug_sync_bits(), rz_core_reg_default(), rz_core_reg_getv_by_role_or_name(), rz_core_reg_set_by_role_or_name(), and rz_core_reg_update_flags().
Definition at line 638 of file cdebug.c.
References addr, colors, dbg, i, maps(), print_debug_maps_ascii_art(), and rz_debug_map_list().
Referenced by rz_cmd_debug_list_maps_ascii_handler().
RZ_API void rz_debug_trace_print | ( | RzDebug * | dbg, |
RzCmdStateOutput * | state, | ||
ut64 | offset | ||
) |
Print all traces
dbg | core->dbg |
mode | output mode, default RZ_OUTPUT_MODE_STANDARD |
offset | offset of address |
Definition at line 658 of file cdebug.c.
References rz_debug_tracepoint_t::addr, rz_debug_tracepoint_t::count, dbg, PFMT64x, rz_cons_printf(), RZ_OUTPUT_MODE_QUIET, RZ_OUTPUT_MODE_RIZIN, RZ_OUTPUT_MODE_STANDARD, rz_return_if_fail, rz_debug_tracepoint_t::size, rz_debug_trace_t::tag, rz_debug_tracepoint_t::tag, test-lz4-versions::tag, rz_debug_tracepoint_t::times, rz_debug_t::trace, and rz_debug_trace_t::traces.
Referenced by rz_cmd_debug_traces_handler().
Print trace info in ASCII Art
dbg | core->dbg |
offset | offset of address |
Definition at line 688 of file cdebug.c.
References RzTable::cons, dbg, free(), rz_io_bind_t::io, rz_debug_t::iob, NULL, rz_cons_get_size(), rz_cons_printf(), rz_cons_singleton(), rz_debug_traces_info(), rz_list_free(), rz_return_if_fail, rz_table_free(), rz_table_new(), rz_table_tostring(), rz_table_visual_list(), s, and rz_io_t::va.
Referenced by rz_cmd_debug_traces_ascii_handler().