Rizin
unix-like reverse engineering framework and cli tools
|
Go to the source code of this file.
Macros | |
#define | CMP(x, y) (x > y.address ? 1 : (x < y.address ? -1 : 0)) |
Definition at line 39 of file dbginfo.c.
References a, rz_bin_source_line_sample_t::address, b, rz_bin_source_line_sample_t::column, rz_bin_source_line_sample_t::file, rz_bin_source_line_sample_t::line, rz_bin_source_line_sample_is_closing(), and sb.
Referenced by rz_bin_source_line_info_builder_build_and_fini().
RZ_DEPRECATE RZ_API bool rz_bin_addr2line | ( | RzBin * | bin, |
ut64 | addr, | ||
char * | file, | ||
int | len, | ||
int * | line | ||
) |
Definition at line 194 of file dbginfo.c.
References addr, len, setup::line, rz_bin_source_line_info_get_first_at(), rz_return_val_if_fail, rz_str_ncpy(), and s.
Referenced by core_analysis_graph_label(), and step_line().
RZ_DEPRECATE RZ_API char* rz_bin_addr2text | ( | RzBin * | bin, |
ut64 | addr, | ||
int | origin | ||
) |
Definition at line 217 of file dbginfo.c.
References addr, free(), NULL, out, PFMT32u, rz_bin_source_line_info_get_first_at(), rz_bin_source_line_info_get_next(), rz_file_slurp_line(), rz_return_val_if_fail, rz_str_newf(), rz_str_trim(), s, and strdup().
Referenced by ds_print_dwarf(), and rabin_show_srcline().
RZ_API RzBinSourceLineInfo* rz_bin_source_line_info_builder_build_and_fini | ( | RzBinSourceLineInfoBuilder * | builder | ) |
Definition at line 87 of file dbginfo.c.
References rz_bin_source_line_sample_t::address, err, rz_bin_source_line_info_builder_t::filename_pool, free(), i, line_sample_cmp(), NULL, r, rz_bin_source_line_info_builder_fini(), rz_bin_source_line_sample_is_closing(), RZ_NEW0, RZ_NEWS0, rz_pvector_at(), rz_pvector_fini(), rz_pvector_init(), rz_pvector_push(), rz_pvector_reserve(), rz_pvector_sort(), rz_vector_fini(), rz_vector_flush(), rz_vector_len(), and rz_bin_source_line_info_builder_t::samples.
Referenced by lines(), and parse_line_raw().
RZ_API void rz_bin_source_line_info_builder_fini | ( | RzBinSourceLineInfoBuilder * | builder | ) |
Definition at line 14 of file dbginfo.c.
References rz_bin_source_line_info_builder_t::filename_pool, rz_str_constpool_fini(), rz_vector_fini(), and rz_bin_source_line_info_builder_t::samples.
Referenced by rz_bin_source_line_info_builder_build_and_fini().
RZ_API void rz_bin_source_line_info_builder_init | ( | RzBinSourceLineInfoBuilder * | builder | ) |
Definition at line 9 of file dbginfo.c.
References rz_bin_source_line_info_builder_t::filename_pool, NULL, rz_str_constpool_init(), rz_vector_init(), and rz_bin_source_line_info_builder_t::samples.
Referenced by lines(), and parse_line_raw().
RZ_API void rz_bin_source_line_info_builder_push_sample | ( | RzBinSourceLineInfoBuilder * | builder, |
ut64 | address, | ||
ut32 | line, | ||
ut32 | column, | ||
const char * | file | ||
) |
Push a new sample into the builder.
This function is used to continuously fill the builder with concrete samples of line info for a specific address, usually during parsing of debug info from a file. The samples may be pushed in any order and the builder will later take care of generating a valid RzBinSourceLineInfo from it.
line | may be 0 or a positive line number, where 0 means that this entry closes the one before it. see also RzBinSourceLine. |
Definition at line 28 of file dbginfo.c.
References rz_bin_source_line_sample_t::address, rz_bin_source_line_sample_t::column, rz_bin_source_line_sample_t::file, rz_bin_source_line_info_builder_t::filename_pool, rz_bin_source_line_sample_t::line, setup::line, NULL, rz_str_constpool_get(), rz_vector_push(), and rz_bin_source_line_info_builder_t::samples.
Referenced by lines(), rz_bin_dwarf_line_op_run(), and store_line_sample().
RZ_API void rz_bin_source_line_info_free | ( | RzBinSourceLineInfo * | sli | ) |
Definition at line 137 of file dbginfo.c.
References rz_bin_source_line_info_t::filename_pool, free(), rz_str_constpool_fini(), and rz_bin_source_line_info_t::samples.
Referenced by rz_bin_dwarf_line_info_free(), and rz_bin_object_free().
RZ_API const RzBinSourceLineSample* rz_bin_source_line_info_get_first_at | ( | const RzBinSourceLineInfo * | sli, |
ut64 | addr | ||
) |
Find the first sample that affects the given address. i.e. find the first sample with the highest address less or equal to addr. There may be more which can be retrieved by repeatedly calling rz_bin_source_line_info_get_next() until it returns NULL.
Definition at line 151 of file dbginfo.c.
References addr, CMP, NULL, r, rz_array_upper_bound, rz_bin_source_line_sample_is_closing(), rz_bin_source_line_info_t::samples, and rz_bin_source_line_info_t::samples_count.
Referenced by print_source_info(), rz_bin_addr2line(), and rz_bin_addr2text().
RZ_API const RzBinSourceLineSample* rz_bin_source_line_info_get_next | ( | const RzBinSourceLineInfo * | sli, |
RZ_NONNULL const RzBinSourceLineSample * | cur | ||
) |
cur | MUST be a pointer returned by either rz_bin_source_line_info_get_first_at() or rz_bin_source_line_info_get_next(). |
Definition at line 182 of file dbginfo.c.
References rz_bin_source_line_sample_t::address, NULL, rz_return_val_if_fail, rz_bin_source_line_info_t::samples, and rz_bin_source_line_info_t::samples_count.
Referenced by print_source_info(), and rz_bin_addr2text().