Rizin
unix-like reverse engineering framework and cli tools
|
Go to the source code of this file.
Macros | |
#define | D0 if (1) |
#define | D1 if (1) |
#define | DWARF_DUMP 0 |
#define | DBGFD NULL |
#define | STANDARD_OPERAND_COUNT_DWARF2 9 |
#define | STANDARD_OPERAND_COUNT_DWARF3 12 |
#define | RZ_BIN_DWARF_INFO 1 |
#define | READ8(buf) |
#define | READ16(buf) |
#define | READ32(buf) |
#define | READ64(buf) |
Variables | |
static const char * | dwarf_tag_name_encodings [] |
static const char * | dwarf_attr_encodings [] |
static const char * | dwarf_attr_form_encodings [] |
static const char * | dwarf_langs [] |
static const char * | dwarf_unit_types [] |
#define READ16 | ( | buf | ) |
#define READ32 | ( | buf | ) |
#define READ64 | ( | buf | ) |
#define READ8 | ( | buf | ) |
Definition at line 394 of file dwarf.c.
References a, b, and RzBinDwarfAbbrevDecl::offset.
Referenced by parse_info_raw().
|
inlinestatic |
Definition at line 2168 of file dwarf.c.
References list(), rz_list_new(), and RZ_NEW0.
Referenced by parse_loc_raw().
|
inlinestatic |
Definition at line 2177 of file dwarf.c.
References test_evm::end, capstone::range, RZ_NEW0, and start.
Referenced by parse_loc_raw().
|
inlinestatic |
Definition at line 440 of file dwarf.c.
References READ16, READ32, READ64, RZ_LOG_WARN, and ut64().
Referenced by parse_aranges_raw(), parse_ext_opcode(), and parse_loc_raw().
|
inlinestatic |
Read an "initial length" value, as specified by dwarf. This also determines whether it is 64bit or 32bit and reads 4 or 12 bytes respectively.
Definition at line 411 of file dwarf.c.
References DWARF_INIT_LEN_64, r, READ32, READ64, and ut64().
Referenced by parse_aranges_raw(), and parse_line_header().
|
inlinestatic |
Reads 64/32 bit unsigned based on format.
is_64bit | Format of the comp unit |
buf | Pointer to the buffer to read from, to update after read |
buf_end | To check the boundary /for READ macro/ |
Definition at line 430 of file dwarf.c.
References READ32, READ64, and ut64().
Referenced by info_comp_unit_read_hdr(), parse_aranges_raw(), parse_attr_value(), and parse_line_header().
|
static |
Definition at line 1281 of file dwarf.c.
References RzBinDwarfAbbrevDecl::capacity, RzBinDwarfAbbrevDecl::count, RzBinDwarfAbbrevDecl::defs, EINVAL, ENOMEM, memset(), realloc(), and autogen_x86imm::tmp.
Referenced by parse_abbrev_raw().
|
static |
Definition at line 1244 of file dwarf.c.
References RzBinDwarfCompUnit::capacity, RzBinDwarfCompUnit::count, RzBinDwarfCompUnit::dies, EINVAL, ENOMEM, memset(), realloc(), and autogen_x86imm::tmp.
Referenced by parse_comp_unit().
|
static |
Definition at line 1318 of file dwarf.c.
References RzBinDwarfDebugAbbrev::capacity, RzBinDwarfDebugAbbrev::count, RzBinDwarfDebugAbbrev::decls, EINVAL, ENOMEM, memset(), realloc(), and autogen_x86imm::tmp.
Referenced by parse_abbrev_raw().
|
static |
Definition at line 1868 of file dwarf.c.
References info(), memset(), realloc(), rz_return_val_if_fail, and autogen_x86imm::tmp.
Referenced by parse_info_raw().
|
static |
Definition at line 1420 of file dwarf.c.
References calloc(), RzBinDwarfBlock::data, RzBinDwarfBlock::length, NULL, and READ8.
Referenced by parse_attr_value(), and parse_loc_raw().
|
static |
Definition at line 1361 of file dwarf.c.
References DW_FORM_block, DW_FORM_block1, DW_FORM_block2, DW_FORM_block4, DW_FORM_exprloc, DW_FORM_string, DW_FORM_strp, RZ_FREE, and val.
Referenced by free_die().
|
static |
Definition at line 1394 of file dwarf.c.
References RzBinDwarfCompUnit::count, RzBinDwarfCompUnit::dies, free_die(), i, and RZ_FREE.
Referenced by rz_bin_dwarf_debug_info_free().
|
static |
Definition at line 1383 of file dwarf.c.
References RzBinDwarfDie::attr_values, RzBinDwarfDie::count, free_attr_value(), i, and RZ_FREE.
Referenced by free_comp_unit().
|
static |
|
static |
Definition at line 2277 of file dwarf.c.
References free_loc_table_list().
Referenced by rz_bin_dwarf_loc_free().
|
static |
Definition at line 2187 of file dwarf.c.
References free(), rz_bin_dwarf_loc_list_t::list, capstone::range, and rz_list_free().
Referenced by free_loc_table_entry(), and parse_loc_raw().
|
static |
Definition at line 599 of file dwarf.c.
References header, info(), NULL, and rz_bin_dwarf_line_header_get_full_file_path().
Referenced by store_line_sample().
Definition at line 2053 of file dwarf.c.
References rz_bin_file_t::buf, calloc(), getsection(), len, NULL, rz_buf_read_at(), RZ_MIN, rz_return_val_if_fail, section::size, and rz_bin_file_t::size.
Referenced by rz_bin_dwarf_parse_abbrev(), rz_bin_dwarf_parse_aranges(), rz_bin_dwarf_parse_info(), rz_bin_dwarf_parse_line(), and rz_bin_dwarf_parse_loc().
|
static |
Definition at line 2034 of file dwarf.c.
References NULL, rz_bin_file_t::o, rz_return_val_if_fail, and rz_bin_object_t::sections.
Referenced by get_section_bytes().
|
static |
Reads all information about compilation unit header.
buf | Start of the buffer |
buf_end | Upper bound of the buffer |
unit | Unit to read information into |
Definition at line 1840 of file dwarf.c.
References RzBinDwarfCompUnitHdr::abbrev_offset, RzBinDwarfCompUnitHdr::address_size, DW_UT_skeleton, DW_UT_split_compile, DW_UT_split_type, DW_UT_type, DWARF_INIT_LEN_64, dwarf_read_offset(), RzBinDwarfCompUnitHdr::dwo_id, RzBinDwarfCompUnitHdr::header_size, RzBinDwarfCompUnitHdr::is_64bit, RzBinDwarfCompUnitHdr::length, READ16, READ32, READ64, READ8, autogen_x86imm::tmp, RzBinDwarfCompUnitHdr::type_offset, RzBinDwarfCompUnitHdr::type_sig, RzBinDwarfCompUnitHdr::unit_type, and RzBinDwarfCompUnitHdr::version.
Referenced by parse_info_raw().
|
static |
Definition at line 1265 of file dwarf.c.
References ABBREV_DECL_CAP, calloc(), RzBinDwarfAbbrevDecl::capacity, RzBinDwarfAbbrevDecl::count, RzBinDwarfAbbrevDecl::defs, EINVAL, and ENOMEM.
Referenced by parse_abbrev_raw().
|
static |
Definition at line 1231 of file dwarf.c.
References calloc(), RzBinDwarfCompUnit::capacity, COMP_UNIT_CAPACITY, RzBinDwarfCompUnit::count, RzBinDwarfCompUnit::dies, EINVAL, and ENOMEM.
Referenced by parse_info_raw().
|
static |
Definition at line 1304 of file dwarf.c.
References calloc(), RzBinDwarfDebugAbbrev::capacity, RzBinDwarfDebugAbbrev::count, DEBUG_ABBREV_CAP, RzBinDwarfDebugAbbrev::decls, EINVAL, and ENOMEM.
Referenced by parse_abbrev_raw().
|
static |
Definition at line 1196 of file dwarf.c.
References DEBUG_INFO_CAPACITY, free_ht_comp_dir(), inf(), NULL, RZ_FREE, and RZ_NEWS0.
Referenced by parse_info_raw().
|
static |
Definition at line 1213 of file dwarf.c.
References RzBinDwarfDie::abbrev_code, RzBinDwarfDie::attr_values, calloc(), RzBinDwarfDie::capacity, RzBinDwarfDie::count, and NULL.
Referenced by parse_comp_unit().
|
static |
Definition at line 460 of file dwarf.c.
References RzBinDwarfLineHeader::file_names, RzBinDwarfLineHeader::file_names_count, free(), i, RzBinDwarfLineHeader::include_dirs, RzBinDwarfLineHeader::include_dirs_count, rz_bin_dwarf_line_file_entry_t::name, and RzBinDwarfLineHeader::std_opcode_lengths.
Referenced by line_unit_free().
|
static |
Definition at line 982 of file dwarf.c.
References free(), RzBinDwarfLineUnit::header, i, line_header_fini(), RzBinDwarfLineUnit::ops, RzBinDwarfLineUnit::ops_count, and rz_bin_dwarf_line_op_fini().
Referenced by parse_line_raw().
|
static |
Definition at line 1973 of file dwarf.c.
References RzBinDwarfAttrDef::attr_form, RzBinDwarfAttrDef::attr_name, RzBinDwarfAbbrevDecl::capacity, RzBinDwarfDebugAbbrev::capacity, RzBinDwarfAbbrevDecl::code, RzBinDwarfAbbrevDecl::count, RzBinDwarfDebugAbbrev::count, RzBinDwarfDebugAbbrev::decls, RzBinDwarfAbbrevDecl::defs, DW_FORM_implicit_const, expand_abbrev_decl(), expand_debug_abbrev(), RzBinDwarfAbbrevDecl::has_children, init_abbrev_decl(), init_debug_abbrev(), len, NULL, obuf, RzBinDwarfAbbrevDecl::offset, READ8, rz_leb128(), RZ_NEW0, rz_uleb128(), RzBinDwarfAttrDef::special, special(), st64, RzBinDwarfAbbrevDecl::tag, autogen_x86imm::tmp, and ut64().
Referenced by rz_bin_dwarf_parse_abbrev().
Definition at line 1114 of file dwarf.c.
References rz_bin_dwarf_arange_t::addr, rz_bin_dwarf_arange_set_t::address_size, rz_bin_dwarf_arange_set_t::aranges, rz_bin_dwarf_arange_set_t::aranges_count, rz_bin_dwarf_arange_set_t::debug_info_offset, dwarf_read_address(), dwarf_read_initial_length(), dwarf_read_offset(), free(), i, rz_bin_dwarf_arange_set_t::is_64bit, rz_bin_dwarf_arange_t::length, NULL, obuf, off, pad(), r, READ16, READ8, rz_bin_dwarf_arange_set_free(), rz_list_newf(), rz_list_push(), RZ_NEW, RZ_NEWS0, rz_num_align_delta(), rz_return_val_if_fail, rz_bin_dwarf_arange_set_t::segment_size, start, rz_bin_dwarf_arange_set_t::unit_length, ut64(), and rz_bin_dwarf_arange_set_t::version.
Referenced by rz_bin_dwarf_parse_aranges().
|
static |
Parses attribute value based on its definition and stores it into value
This function is quite incomplete and requires lot of work With parsing various new FORM values
obuf | |
obuf_len | Buffer max capacity |
def | Attribute definition |
value | Parsed value storage |
hdr | Current unit header |
debug_str | Ptr to string section start |
debug_str_len | Length of the string section |
Definition at line 1450 of file dwarf.c.
References RzBinDwarfCompUnitHdr::address_size, calloc(), def(), DW_AT_KIND_ADDRESS, DW_AT_KIND_BLOCK, DW_AT_KIND_CONSTANT, DW_AT_KIND_FLAG, DW_AT_KIND_LOCLISTPTR, DW_AT_KIND_REFERENCE, DW_AT_KIND_STRING, DW_FORM_addr, DW_FORM_addrx, DW_FORM_addrx1, DW_FORM_addrx2, DW_FORM_addrx3, DW_FORM_addrx4, DW_FORM_block, DW_FORM_block1, DW_FORM_block2, DW_FORM_block4, DW_FORM_data1, DW_FORM_data16, DW_FORM_data2, DW_FORM_data4, DW_FORM_data8, DW_FORM_exprloc, DW_FORM_flag, DW_FORM_flag_present, DW_FORM_implicit_const, DW_FORM_line_ptr, DW_FORM_loclistx, DW_FORM_ref1, DW_FORM_ref2, DW_FORM_ref4, DW_FORM_ref8, DW_FORM_ref_addr, DW_FORM_ref_sig8, DW_FORM_ref_sup4, DW_FORM_ref_sup8, DW_FORM_ref_udata, DW_FORM_rnglistx, DW_FORM_sdata, DW_FORM_sec_offset, DW_FORM_string, DW_FORM_strp, DW_FORM_strp_sup, DW_FORM_strx, DW_FORM_strx1, DW_FORM_strx2, DW_FORM_strx3, DW_FORM_strx4, DW_FORM_udata, dwarf_read_offset(), fill_block_data(), RzBinDwarfCompUnitHdr::is_64bit, NULL, obuf, PFMT64x, READ16, READ32, READ64, READ8, rz_leb128(), RZ_LOG_ERROR, rz_return_val_if_fail, rz_str_ndup(), rz_uleb128(), RzBinDwarfCompUnitHdr::unit_offset, and value.
Referenced by parse_die().
|
static |
Reads throught comp_unit buffer and parses all its DIEntries.
buf_start | Start of the compilation unit data |
unit | Unit to store the newly parsed information |
abbrevs | Parsed abbrev section info of all abbreviations |
first_abbr_idx | index for first abbrev of the current comp unit in abbrev array |
debug_str | Ptr to string section start |
debug_str_len | Length of the string section |
Definition at line 1776 of file dwarf.c.
References RzBinDwarfCompUnit::capacity, RzBinDwarfCompUnit::count, RzBinDwarfAbbrevDecl::count, RzBinDwarfDebugAbbrev::count, RzBinDwarfDebugAbbrev::decls, RzBinDwarfCompUnit::dies, expand_cu(), RzBinDwarfDie::has_children, RzBinDwarfAbbrevDecl::has_children, RzBinDwarfCompUnit::hdr, RzBinDwarfCompUnitHdr::header_size, info(), init_die(), RzBinDwarfCompUnitHdr::is_64bit, RzBinDwarfCompUnitHdr::length, NULL, RzBinDwarfDie::offset, RzBinDwarfCompUnit::offset, parse_die(), rz_uleb128(), RzBinDwarfDie::tag, RzBinDwarfAbbrevDecl::tag, and ut64().
Referenced by parse_info_raw().
|
static |
buf | Start of the DIE data |
buf_end | |
info | debug info where the line_info_offset_comp_dir will be populated if such an entry is found |
abbrev | Abbreviation of the DIE |
hdr | Unit header |
die | DIE to store the parsed info into |
debug_str | Ptr to string section start |
debug_str_len | Length of the string section |
Definition at line 1722 of file dwarf.c.
References dwarf_attr_kind::attr_form, dwarf_attr_kind::attr_name, RzBinDwarfDie::attr_values, RzBinDwarfDie::count, RzBinDwarfAbbrevDecl::count, RzBinDwarfAbbrevDecl::defs, DW_AT_comp_dir, DW_AT_KIND_CONSTANT, DW_AT_KIND_REFERENCE, DW_AT_stmt_list, DW_FORM_string, DW_FORM_strp, free(), i, info(), dwarf_attr_kind::kind, memset(), NULL, parse_attr_value(), dwarf_attr_kind::reference, strdup(), dwarf_attr_kind::string, dwarf_attr_kind::uconstant, ut64(), and UT64_MAX.
Referenced by parse_comp_unit().
|
static |
Definition at line 706 of file dwarf.c.
References RzBinDwarfLineHeader::address_size, DW_LNE_define_file, DW_LNE_end_sequence, DW_LNE_set_address, DW_LNE_set_discriminator, dwarf_read_address(), fn, len, malloc(), memcpy(), NULL, obuf, RZ_BIN_DWARF_LINE_OP_TYPE_EXT, rz_return_val_if_fail, rz_str_nlen(), rz_uleb128(), ut64(), and RzBinDwarfLineHeader::version.
Referenced by parse_opcodes().
|
static |
Parses whole .debug_info section.
da | Parsed Abbreviations |
obuf | .debug_info section buffer start |
len | length of the section buffer |
debug_str | start of the .debug_str section |
debug_str_len | length of the debug_str section |
big_endian |
Definition at line 1897 of file dwarf.c.
References abbrev_cmp(), RzBinDwarfCompUnitHdr::abbrev_offset, RzBinDwarfDebugAbbrev::capacity, cleanup(), RzBinDwarfCompUnit::count, RzBinDwarfAbbrevDecl::count, RzBinDwarfDebugAbbrev::count, RzBinDwarfDebugAbbrev::decls, expand_info(), RzBinDwarfCompUnit::hdr, info(), info_comp_unit_read_hdr(), init_comp_unit(), init_debug_info(), key, len, RzBinDwarfCompUnitHdr::length, NULL, obuf, RzBinDwarfCompUnit::offset, parse_comp_unit(), rz_bin_dwarf_debug_info_free(), RZ_LOG_WARN, RZ_NEW0, rz_return_val_if_fail, rz_warn_if_fail, and RzBinDwarfCompUnitHdr::unit_offset.
Referenced by rz_bin_dwarf_parse_info().
|
static |
Definition at line 638 of file dwarf.c.
References RzBinDwarfLineHeader::address_size, calloc(), RzBinDwarfLineHeader::default_is_stmt, dwarf_read_initial_length(), dwarf_read_offset(), RzBinDwarfLineHeader::file_names, RzBinDwarfLineHeader::header_length, i, RzBinDwarfLineHeader::is_64bit, RzBinDwarfLineHeader::line_base, RzBinDwarfLineHeader::line_range, RzBinDwarfLineHeader::max_ops_per_inst, RzBinDwarfLineHeader::min_inst_len, NULL, RzBinDwarfLineHeader::offset, RzBinDwarfLineHeader::opcode_base, parse_line_header_source(), READ16, READ8, rz_return_val_if_fail, RzBinDwarfLineHeader::segment_selector_size, st8, RzBinDwarfLineHeader::std_opcode_lengths, RzBinDwarfLineHeader::unit_length, and RzBinDwarfLineHeader::version.
Referenced by parse_line_raw().
|
static |
Definition at line 479 of file dwarf.c.
References RzBinDwarfLineHeader::file_names, RzBinDwarfLineHeader::file_names_count, free(), RzBinDwarfLineHeader::include_dirs, RzBinDwarfLineHeader::include_dirs_count, len, maxlen, entry::name, NULL, RZ_MIN, rz_pvector_fini(), rz_pvector_flush(), rz_pvector_init(), rz_pvector_len(), rz_pvector_push(), rz_str_ndup(), rz_str_nlen(), rz_uleb128(), rz_vector_fini(), rz_vector_flush(), rz_vector_init(), rz_vector_len(), rz_vector_push(), cmd_descs_generate::str, and ut64().
Referenced by parse_line_header().
|
static |
Definition at line 996 of file dwarf.c.
References rz_bin_info_t::bits, buf_size, free(), RzBinDwarfLineUnit::header, info(), rz_bin_object_t::info, RzBinDwarfLineHeader::is_64bit, len, line_unit_free(), RzBinDwarfLineInfo::lines, mask, NULL, rz_bin_file_t::o, obuf, ops, RzBinDwarfLineUnit::ops, RzBinDwarfLineUnit::ops_count, parse_line_header(), parse_opcodes(), regs, rz_bin_dwarf_line_header_free_file_cache(), rz_bin_dwarf_line_header_new_file_cache(), rz_bin_dwarf_line_header_reset_regs(), RZ_BIN_DWARF_LINE_INFO_MASK_LINES, RZ_BIN_DWARF_LINE_INFO_MASK_OPS, rz_bin_source_line_info_builder_build_and_fini(), rz_bin_source_line_info_builder_init(), rz_list_newf(), rz_list_push(), RZ_MIN, RZ_NEW0, rz_return_val_if_fail, rz_vector_fini(), rz_vector_flush(), rz_vector_init(), rz_vector_len(), RzBinDwarfLineHeader::unit_length, RzBinDwarfLineInfo::units, and ut64().
Referenced by rz_bin_dwarf_parse_line().
|
static |
Definition at line 2199 of file dwarf.c.
References create_loc_list(), create_loc_range(), dwarf_read_address(), fill_block_data(), free(), free_loc_table_list(), get_max_offset(), len, RzBinDwarfBlock::length, rz_bin_dwarf_loc_list_t::list, NULL, rz_bin_dwarf_loc_list_t::offset, capstone::range, READ16, rz_list_append(), RZ_NEW0, and ut64().
Referenced by rz_bin_dwarf_parse_loc().
|
static |
Definition at line 939 of file dwarf.c.
References info(), len, obuf, RzBinDwarfLineHeader::opcode_base, parse_ext_opcode(), parse_std_opcode(), regs, rz_bin_dwarf_line_op_fini(), rz_bin_dwarf_line_op_run(), RZ_BIN_DWARF_LINE_OP_TYPE_SPEC, and rz_vector_push().
Referenced by parse_line_raw().
|
static |
Definition at line 774 of file dwarf.c.
References DW_LNS_advance_line, DW_LNS_advance_pc, DW_LNS_const_add_pc, DW_LNS_copy, DW_LNS_fixed_advance_pc, DW_LNS_negate_stmt, DW_LNS_set_basic_block, DW_LNS_set_column, DW_LNS_set_epilogue_begin, DW_LNS_set_file, DW_LNS_set_isa, DW_LNS_set_prologue_end, i, len, NULL, obuf, READ16, RZ_BIN_DWARF_LINE_OP_TYPE_STD, rz_leb128(), rz_return_val_if_fail, rz_uleb128(), and std_opcode_args_count().
Referenced by parse_opcodes().
RZ_API void rz_bin_dwarf_arange_set_free | ( | RzBinDwarfARangeSet * | set | ) |
Definition at line 1106 of file dwarf.c.
References rz_bin_dwarf_arange_set_t::aranges, and free().
Referenced by parse_aranges_raw().
RZ_API void rz_bin_dwarf_debug_abbrev_free | ( | RzBinDwarfDebugAbbrev * | da | ) |
Definition at line 1340 of file dwarf.c.
References RzBinDwarfDebugAbbrev::count, RzBinDwarfDebugAbbrev::decls, RzBinDwarfAbbrevDecl::defs, free(), i, and RZ_FREE.
Referenced by bin_dwarf(), and rz_core_bin_apply_dwarf().
RZ_API void rz_bin_dwarf_debug_info_free | ( | RzBinDwarfDebugInfo * | inf | ) |
Definition at line 1407 of file dwarf.c.
References free(), free_comp_unit(), i, and inf().
Referenced by bin_dwarf(), parse_info_raw(), rz_bin_dwarf_parse_info(), and rz_core_bin_apply_dwarf().
Definition at line 373 of file dwarf.c.
References DW_FORM_addrx4, dwarf_attr_form_encodings, and NULL.
Referenced by rz_core_bin_dwarf_print_abbrev_section().
Definition at line 323 of file dwarf.c.
References DW_AT_GNU_addr_base, DW_AT_GNU_all_call_sites, DW_AT_GNU_all_source_call_sites, DW_AT_GNU_all_tail_call_sites, DW_AT_GNU_call_site_data_value, DW_AT_GNU_call_site_target, DW_AT_GNU_call_site_target_clobbered, DW_AT_GNU_call_site_value, DW_AT_GNU_deleted, DW_AT_GNU_dwo_id, DW_AT_GNU_dwo_name, DW_AT_GNU_macros, DW_AT_GNU_pubnames, DW_AT_GNU_pubtypes, DW_AT_GNU_ranges_base, DW_AT_GNU_tail_call, DW_AT_hi_user, DW_AT_lo_user, DW_AT_MIPS_linkage_name, dwarf_attr_encodings, NULL, and RZ_ARRAY_SIZE.
Referenced by rz_core_bin_dwarf_print_abbrev_section(), and rz_core_bin_dwarf_print_debug_info().
Definition at line 387 of file dwarf.c.
References dwarf_langs, NULL, and RZ_ARRAY_SIZE.
Referenced by rz_core_bin_dwarf_print_attr_value().
Definition at line 316 of file dwarf.c.
References DW_TAG_LAST, dwarf_tag_name_encodings, NULL, and test-lz4-versions::tag.
Referenced by rz_core_bin_dwarf_print_abbrev_section(), and rz_core_bin_dwarf_print_debug_info().
Definition at line 380 of file dwarf.c.
References DW_UT_split_type, dwarf_unit_types, and NULL.
Referenced by rz_core_bin_dwarf_print_debug_info().
RZ_API void rz_bin_dwarf_line_header_free_file_cache | ( | const RzBinDwarfLineHeader * | hdr, |
RzBinDwarfLineFileCache | fnc | ||
) |
Definition at line 589 of file dwarf.c.
References RzBinDwarfLineHeader::file_names_count, free(), and i.
Referenced by parse_line_raw().
RZ_API ut64 rz_bin_dwarf_line_header_get_adj_opcode | ( | const RzBinDwarfLineHeader * | header, |
ut8 | opcode | ||
) |
Definition at line 613 of file dwarf.c.
References header, and rz_return_val_if_fail.
Referenced by print_line_op(), rz_bin_dwarf_line_header_get_spec_op_advance_line(), and rz_bin_dwarf_line_header_get_spec_op_advance_pc().
RZ_API char* rz_bin_dwarf_line_header_get_full_file_path | ( | RZ_NULLABLE const RzBinDwarfDebugInfo * | info, |
const RzBinDwarfLineHeader * | header, | ||
ut64 | file_index | ||
) |
info | if not NULL, filenames can get resolved to absolute paths using the compilation unit dirs from it |
Definition at line 547 of file dwarf.c.
References free(), header, info(), file::name, NULL, r, rz_return_val_if_fail, and rz_str_newf().
Referenced by get_full_file_path().
RZ_API st64 rz_bin_dwarf_line_header_get_spec_op_advance_line | ( | const RzBinDwarfLineHeader * | header, |
ut8 | opcode | ||
) |
Definition at line 628 of file dwarf.c.
References header, rz_bin_dwarf_line_header_get_adj_opcode(), and rz_return_val_if_fail.
Referenced by print_line_op(), and rz_bin_dwarf_line_op_run().
RZ_API ut64 rz_bin_dwarf_line_header_get_spec_op_advance_pc | ( | const RzBinDwarfLineHeader * | header, |
ut8 | opcode | ||
) |
Definition at line 618 of file dwarf.c.
References header, rz_bin_dwarf_line_header_get_adj_opcode(), and rz_return_val_if_fail.
Referenced by print_line_op(), and rz_bin_dwarf_line_op_run().
RZ_API RzBinDwarfLineFileCache rz_bin_dwarf_line_header_new_file_cache | ( | const RzBinDwarfLineHeader * | hdr | ) |
Definition at line 585 of file dwarf.c.
References RzBinDwarfLineHeader::file_names_count, and RZ_NEWS0.
Referenced by parse_line_raw().
RZ_API void rz_bin_dwarf_line_header_reset_regs | ( | const RzBinDwarfLineHeader * | hdr, |
RzBinDwarfSMRegisters * | regs | ||
) |
Definition at line 824 of file dwarf.c.
References RzBinDwarfLineHeader::default_is_stmt, DWARF_FALSE, regs, and rz_return_if_fail.
Referenced by parse_line_raw(), rz_bin_dwarf_line_op_run(), and rz_core_bin_dwarf_print_line_units().
RZ_API void rz_bin_dwarf_line_info_free | ( | RzBinDwarfLineInfo * | li | ) |
Definition at line 1352 of file dwarf.c.
References free(), RzBinDwarfLineInfo::lines, rz_bin_source_line_info_free(), rz_list_free(), and RzBinDwarfLineInfo::units.
Referenced by bin_dwarf().
RZ_API void rz_bin_dwarf_line_op_fini | ( | RzBinDwarfLineOp * | op | ) |
Definition at line 699 of file dwarf.c.
References DW_LNE_define_file, free(), RZ_BIN_DWARF_LINE_OP_TYPE_EXT, and rz_return_if_fail.
Referenced by line_unit_free(), and parse_opcodes().
RZ_API bool rz_bin_dwarf_line_op_run | ( | const RzBinDwarfLineHeader * | hdr, |
RzBinDwarfSMRegisters * | regs, | ||
RzBinDwarfLineOp * | op, | ||
RZ_NULLABLE RzBinSourceLineInfoBuilder * | bob, | ||
RZ_NULLABLE RzBinDwarfDebugInfo * | info, | ||
RZ_NULLABLE RzBinDwarfLineFileCache | fnc | ||
) |
Execute a single line op on regs and optionally store the resulting line info in bob.
fnc | if not null, filenames will be resolved to their full paths using this cache. |
Definition at line 851 of file dwarf.c.
References DW_LNE_define_file, DW_LNE_end_sequence, DW_LNE_set_address, DW_LNE_set_discriminator, DW_LNS_advance_line, DW_LNS_advance_pc, DW_LNS_const_add_pc, DW_LNS_copy, DW_LNS_fixed_advance_pc, DW_LNS_negate_stmt, DW_LNS_set_basic_block, DW_LNS_set_column, DW_LNS_set_epilogue_begin, DW_LNS_set_file, DW_LNS_set_isa, DW_LNS_set_prologue_end, DWARF_FALSE, DWARF_TRUE, info(), RzBinDwarfLineHeader::min_inst_len, NULL, regs, rz_bin_dwarf_line_header_get_spec_op_advance_line(), rz_bin_dwarf_line_header_get_spec_op_advance_pc(), rz_bin_dwarf_line_header_reset_regs(), RZ_BIN_DWARF_LINE_OP_TYPE_EXT, RZ_BIN_DWARF_LINE_OP_TYPE_SPEC, RZ_BIN_DWARF_LINE_OP_TYPE_STD, rz_bin_source_line_info_builder_push_sample(), rz_return_val_if_fail, and store_line_sample().
Referenced by parse_opcodes(), and rz_core_bin_dwarf_print_line_units().
RZ_API void rz_bin_dwarf_loc_free | ( | HtUP * | loc_table | ) |
Definition at line 2283 of file dwarf.c.
References free_loc_table_entry(), and rz_return_if_fail.
Referenced by bin_dwarf(), and rz_core_bin_apply_dwarf().
RZ_API RzBinDwarfDebugAbbrev* rz_bin_dwarf_parse_abbrev | ( | RzBinFile * | binfile | ) |
Definition at line 2144 of file dwarf.c.
References free(), get_section_bytes(), len, NULL, parse_abbrev_raw(), and rz_return_val_if_fail.
Referenced by bin_dwarf(), and rz_core_bin_apply_dwarf().
Definition at line 2132 of file dwarf.c.
References rz_bin_info_t::big_endian, free(), get_section_bytes(), rz_bin_object_t::info, len, NULL, rz_bin_file_t::o, parse_aranges_raw(), r, and rz_return_val_if_fail.
Referenced by bin_dwarf().
RZ_API RzBinDwarfDebugInfo* rz_bin_dwarf_parse_info | ( | RzBinFile * | binfile, |
RzBinDwarfDebugAbbrev * | da | ||
) |
Parses .debug_info section.
da | Parsed abbreviations |
bin |
Definition at line 2075 of file dwarf.c.
References rz_bin_info_t::big_endian, RzBinDwarfCompUnit::count, RzBinDwarfCompUnit::dies, free(), get_section_bytes(), i, info(), rz_bin_object_t::info, len, NULL, rz_bin_file_t::o, RzBinDwarfDie::offset, parse_info_raw(), rz_bin_dwarf_debug_info_free(), and rz_return_val_if_fail.
Referenced by bin_dwarf(), and rz_core_bin_apply_dwarf().
RZ_API RzBinDwarfLineInfo* rz_bin_dwarf_parse_line | ( | RzBinFile * | binfile, |
RZ_NULLABLE RzBinDwarfDebugInfo * | info, | ||
RzBinDwarfLineInfoMask | mask | ||
) |
info | if not NULL, filenames can get resolved to absolute paths using the compilation unit dirs from it |
Definition at line 2119 of file dwarf.c.
References rz_bin_info_t::big_endian, free(), get_section_bytes(), info(), rz_bin_object_t::info, len, mask, NULL, rz_bin_file_t::o, parse_line_raw(), r, and rz_return_val_if_fail.
Referenced by bin_dwarf(), and rz_core_bin_apply_dwarf().
Parses out the .debug_loc section into a table that maps each list as offset of a list -> LocationList.
binfile | |
addr_size | machine address size used in executable (necessary for parsing) |
Definition at line 2259 of file dwarf.c.
References rz_bin_info_t::big_endian, free(), get_section_bytes(), rz_bin_object_t::info, len, NULL, rz_bin_file_t::o, parse_loc_raw(), and rz_return_val_if_fail.
Referenced by bin_dwarf(), and rz_core_bin_apply_dwarf().
|
static |
Definition at line 767 of file dwarf.c.
References RzBinDwarfLineHeader::opcode_base, and RzBinDwarfLineHeader::std_opcode_lengths.
Referenced by parse_std_opcode().
|
static |
Definition at line 838 of file dwarf.c.
References get_full_file_path(), info(), NULL, regs, and rz_bin_source_line_info_builder_push_sample().
Referenced by rz_bin_dwarf_line_op_run().
|
static |
Definition at line 105 of file dwarf.c.
Referenced by rz_bin_dwarf_get_attr_name().
|
static |
Definition at line 228 of file dwarf.c.
Referenced by rz_bin_dwarf_get_attr_form_name().
|
static |
Definition at line 274 of file dwarf.c.
Referenced by rz_bin_dwarf_get_lang_name().
|
static |
Definition at line 39 of file dwarf.c.
Referenced by rz_bin_dwarf_get_tag_name().
|
static |
Definition at line 305 of file dwarf.c.
Referenced by rz_bin_dwarf_get_unit_type_name().