Rizin
unix-like reverse engineering framework and cli tools
|
#include <rz_util.h>
#include <rz_type.h>
#include <sdb.h>
#include <rz_analysis.h>
#include <rz_bin_dwarf.h>
#include <string.h>
Go to the source code of this file.
Classes | |
struct | dwarf_parse_context_t |
struct | dwarf_function_t |
struct | dwarf_var_location_t |
struct | dwarf_variable_t |
Typedefs | |
typedef struct dwarf_parse_context_t | Context |
typedef struct dwarf_function_t | Function |
typedef enum dwarf_location_kind | VariableLocationKind |
typedef struct dwarf_var_location_t | VariableLocation |
typedef struct dwarf_variable_t | Variable |
Enumerations | |
enum | dwarf_location_kind { LOCATION_UNKNOWN = 0 , LOCATION_GLOBAL = 1 , LOCATION_BP = 2 , LOCATION_SP = 3 , LOCATION_REGISTER = 4 } |
Functions | |
static void | variable_free (Variable *var) |
static st32 | find_attr_idx (const RzBinDwarfDie *die, st32 attr_name) |
static RzBinDwarfAttrValue * | find_attr (const RzBinDwarfDie *die, st32 attr_name) |
static bool | strbuf_rev_prepend_char (RzStrBuf *sb, const char *s, int c) |
Pasted from rz_strbuf_* Prepends string before a last occurence of character c Used to replicate proper C declaration for function pointers. More... | |
static bool | strbuf_rev_append_char (RzStrBuf *sb, const char *s, const char *needle) |
Pasted from rz_strbuf_* Appends string after a first occurence of character c Used to replicate proper C declaration for function pointers. More... | |
static char * | create_type_name_from_offset (ut64 offset) |
static char * | get_die_name (const RzBinDwarfDie *die) |
Get the DIE name or create unique one from its offset. More... | |
static ut64 | get_die_size (const RzBinDwarfDie *die) |
Get the DIE size in bits. More... | |
static st32 | parse_array_type (Context *ctx, ut64 idx, RzStrBuf *strbuf) |
Parses array type entry signature into strbuf. More... | |
static st32 | parse_type (Context *ctx, const ut64 offset, RzStrBuf *strbuf, ut64 *size, RZ_NONNULL SetU *visited) |
Recursively parses type entry of a certain offset into strbuf saves type size into *size. More... | |
static st32 | parse_type_outer (Context *ctx, const ut64 offset, RzStrBuf *strbuf, ut64 *size) |
Convenience function for calling parse_type with an empty visited set See documentation of parse_type. More... | |
static RzTypeStructMember * | parse_struct_member (Context *ctx, ut64 idx, RzTypeStructMember *result) |
Parses structured entry into *result RzTypeStructMember http://www.dwarfstd.org/doc/DWARF4.pdf#page=102&zoom=100,0,0. More... | |
static RzTypeEnumCase * | parse_enumerator (Context *ctx, ut64 idx, RzTypeEnumCase *result) |
Parses enum entry into *result RzTypeEnumCase http://www.dwarfstd.org/doc/DWARF4.pdf#page=110&zoom=100,0,0. More... | |
static void | parse_structure_type (Context *ctx, ut64 idx) |
Parses a structured entry (structs, classes, unions) into RzBaseType and saves it using rz_analysis_save_base_type () More... | |
static void | parse_enum_type (Context *ctx, ut64 idx) |
Parses a enum entry into RzBaseType and saves it int Sdb using rz_analysis_save_base_type () More... | |
static void | parse_typedef (Context *ctx, ut64 idx) |
Parses a typedef entry into RzBaseType and saves it using rz_analysis_save_base_type () More... | |
static void | parse_atomic_type (Context *ctx, ut64 idx) |
static const char * | get_specification_die_name (const RzBinDwarfDie *die) |
static void | get_spec_die_type (Context *ctx, RzBinDwarfDie *die, RzStrBuf *ret_type) |
static bool | prefer_linkage_name (char *lang) |
static void | parse_abstract_origin (Context *ctx, ut64 offset, RzStrBuf *type, const char **name) |
static const char * | map_dwarf_reg_to_x86_64_reg (ut64 reg_num, VariableLocationKind *kind) |
static const char * | map_dwarf_reg_to_x86_reg (ut64 reg_num, VariableLocationKind *kind) |
static const char * | map_dwarf_reg_to_ppc64_reg (ut64 reg_num, VariableLocationKind *kind) |
static const char * | get_dwarf_reg_name (RZ_NONNULL char *arch, int reg_num, VariableLocationKind *kind, int bits) |
static RzBinDwarfLocRange * | find_largest_loc_range (RzList *loc_list) |
static VariableLocation * | parse_dwarf_location (Context *ctx, const RzBinDwarfAttrValue *loc, const RzBinDwarfAttrValue *frame_base) |
static st32 | parse_function_args_and_vars (Context *ctx, ut64 idx, RzStrBuf *args, RzList *variables) |
static void | sdb_save_dwarf_function (Function *dwarf_fcn, RzList *variables, Sdb *sdb) |
static void | parse_function (Context *ctx, ut64 idx) |
Parse function,it's arguments, variables and save the information into the Sdb. More... | |
static char * | parse_comp_unit_lang (const RzBinDwarfDie *die) |
Get's language from comp unit for demangling. More... | |
static void | parse_type_entry (Context *ctx, ut64 idx) |
Delegates DIE to it's proper parsing method. More... | |
RZ_API void | rz_analysis_dwarf_process_info (const RzAnalysis *analysis, RzAnalysisDwarfContext *ctx) |
Parses type and function information out of DWARF entries and stores them to the sdb for further use. More... | |
bool | filter_sdb_function_names (void *user, const char *k, const char *v) |
RZ_API void | rz_analysis_dwarf_integrate_functions (RzAnalysis *analysis, RzFlag *flags, Sdb *dwarf_sdb) |
Use parsed DWARF function info from Sdb in the function analysis XXX right now we only save parsed name and variables, we can't use signature now XXX refactor to be more readable. More... | |
PCONTEXT Context |
Definition at line 138 of file windows_debug.h.
typedef struct dwarf_function_t Function |
typedef struct dwarf_variable_t Variable |
typedef struct dwarf_var_location_t VariableLocation |
typedef enum dwarf_location_kind VariableLocationKind |
enum dwarf_location_kind |
Enumerator | |
---|---|
LOCATION_UNKNOWN | |
LOCATION_GLOBAL | |
LOCATION_BP | |
LOCATION_SP | |
LOCATION_REGISTER |
Definition at line 34 of file dwarf_process.c.
|
inlinestatic |
Definition at line 157 of file dwarf_process.c.
References PFMT64x, and rz_str_newf().
Referenced by get_die_name(), and parse_atomic_type().
Definition at line 1624 of file dwarf_process.c.
Referenced by rz_analysis_dwarf_integrate_functions().
|
static |
Definition at line 75 of file dwarf_process.c.
References dwarf_attr_kind::attr_name, RzBinDwarfDie::attr_values, RzBinDwarfDie::count, i, NULL, rz_return_val_if_fail, and st32.
Referenced by parse_function_args_and_vars().
|
inlinestatic |
Definition at line 63 of file dwarf_process.c.
References dwarf_attr_kind::attr_name, RzBinDwarfDie::attr_values, RzBinDwarfDie::count, i, rz_return_val_if_fail, and st32.
Referenced by get_die_name(), get_die_size(), get_spec_die_type(), get_specification_die_name(), parse_comp_unit_lang(), parse_enum_type(), parse_function(), parse_structure_type(), and parse_type().
|
static |
Definition at line 997 of file dwarf_process.c.
References NULL, capstone::range, and ut64().
Referenced by parse_dwarf_location().
|
static |
Get the DIE name or create unique one from its offset.
die |
Definition at line 167 of file dwarf_process.c.
References RzBinDwarfDie::attr_values, create_type_name_from_offset(), DW_AT_name, find_attr_idx(), name, NULL, RzBinDwarfDie::offset, rz_bin_dwarf_attr_value_get_string_content(), RZ_STR_DUP, s, and st32.
Referenced by parse_enum_type(), parse_enumerator(), parse_struct_member(), parse_structure_type(), parse_type(), and parse_typedef().
|
static |
Get the DIE size in bits.
die |
Definition at line 183 of file dwarf_process.c.
References RzBinDwarfDie::attr_values, CHAR_BIT, DW_AT_bit_size, DW_AT_byte_size, find_attr_idx(), st32, dwarf_attr_kind::uconstant, and ut64().
Referenced by parse_enum_type(), parse_structure_type(), and parse_type().
|
static |
Definition at line 981 of file dwarf_process.c.
References arch, bits(), LOCATION_UNKNOWN, map_dwarf_reg_to_ppc64_reg(), map_dwarf_reg_to_x86_64_reg(), and map_dwarf_reg_to_x86_reg().
Referenced by parse_dwarf_location().
|
static |
Definition at line 788 of file dwarf_process.c.
References RzBinDwarfDie::attr_values, DW_AT_type, find_attr_idx(), parse_type_outer(), dwarf_attr_kind::reference, st32, and ut64().
Referenced by parse_function().
|
static |
Definition at line 770 of file dwarf_process.c.
References RzBinDwarfDie::attr_values, DW_AT_linkage_name, DW_AT_name, find_attr_idx(), NULL, rz_bin_dwarf_attr_value_get_string_content(), s, and st32.
Referenced by parse_function().
|
static |
Definition at line 935 of file dwarf_process.c.
References LOCATION_REGISTER, LOCATION_SP, LOCATION_UNKNOWN, and rz_warn_if_reached.
Referenced by get_dwarf_reg_name().
|
static |
Definition at line 841 of file dwarf_process.c.
References LOCATION_BP, LOCATION_REGISTER, LOCATION_SP, and LOCATION_UNKNOWN.
Referenced by get_dwarf_reg_name().
|
static |
Definition at line 879 of file dwarf_process.c.
References LOCATION_BP, LOCATION_REGISTER, LOCATION_SP, LOCATION_UNKNOWN, and rz_warn_if_reached.
Referenced by get_dwarf_reg_name().
|
static |
Definition at line 810 of file dwarf_process.c.
References RzBinDwarfDie::attr_values, RzBinDwarfDie::count, DW_AT_linkage_name, DW_AT_MIPS_linkage_name, DW_AT_name, DW_AT_type, i, NULL, parse_type_outer(), prefer_linkage_name(), type, ut64(), and val.
Referenced by parse_function_args_and_vars().
Parses array type entry signature into strbuf.
ctx | |
idx | index of the current entry |
strbuf | strbuf to store the type into |
Definition at line 207 of file dwarf_process.c.
References RzBinDwarfDie::abbrev_code, RzBinDwarfDie::attr_values, RzBinDwarfDie::count, DW_AT_count, DW_AT_upper_bound, DW_TAG_subrange_type, RzBinDwarfDie::has_children, i, setup::idx, PFMT64d, rz_strbuf_appendf(), RzBinDwarfDie::tag, and value.
Referenced by parse_type().
Definition at line 723 of file dwarf_process.c.
References dwarf_attr_kind::attr_name, RzBinDwarfDie::attr_values, CHAR_BIT, RzBinDwarfDie::count, create_type_name_from_offset(), DW_AT_bit_size, DW_AT_byte_size, DW_AT_encoding, DW_AT_name, free(), i, setup::idx, name, rz_base_type_t::name, NULL, RzBinDwarfDie::offset, RZ_BASE_TYPE_KIND_ATOMIC, rz_bin_dwarf_attr_value_get_string_content(), rz_type_base_type_new(), rz_type_db_save_base_type(), s, rz_base_type_t::size, strdup(), ut64(), and value.
Referenced by parse_type_entry().
|
static |
Get's language from comp unit for demangling.
die |
Definition at line 1506 of file dwarf_process.c.
References RzBinDwarfDie::attr_values, DW_AT_KIND_CONSTANT, DW_AT_language, DW_LANG_Ada83, DW_LANG_Ada95, DW_LANG_C, DW_LANG_C11, DW_LANG_C89, DW_LANG_C99, DW_LANG_C_plus_plus, DW_LANG_C_plus_plus_14, DW_LANG_Cobol74, DW_LANG_Cobol85, DW_LANG_D, DW_LANG_Dylan, DW_LANG_Fortran03, DW_LANG_Fortran08, DW_LANG_Fortran77, DW_LANG_Fortran90, DW_LANG_Fortran95, DW_LANG_Java, DW_LANG_Julia, DW_LANG_Modula2, DW_LANG_ObjC, DW_LANG_ObjC_plus_plus, DW_LANG_Pascal83, DW_LANG_PLI, DW_LANG_Python, DW_LANG_Rust, DW_LANG_Swift, DW_LANG_UPC, find_attr_idx(), setup::idx, NULL, rz_return_val_if_fail, rz_warn_if_fail, and val.
Referenced by parse_type_entry().
|
static |
Definition at line 1013 of file dwarf_process.c.
References dwarf_var_location_t::address, dwarf_attr_kind::block, RzBinDwarfBlock::data, DW_AT_KIND_BLOCK, DW_AT_KIND_CONSTANT, DW_AT_KIND_LOCLISTPTR, DW_AT_KIND_REFERENCE, DW_OP_addr, DW_OP_breg0, DW_OP_breg1, DW_OP_breg10, DW_OP_breg11, DW_OP_breg12, DW_OP_breg13, DW_OP_breg14, DW_OP_breg15, DW_OP_breg16, DW_OP_breg17, DW_OP_breg18, DW_OP_breg19, DW_OP_breg2, DW_OP_breg20, DW_OP_breg21, DW_OP_breg22, DW_OP_breg23, DW_OP_breg24, DW_OP_breg25, DW_OP_breg26, DW_OP_breg27, DW_OP_breg28, DW_OP_breg29, DW_OP_breg3, DW_OP_breg30, DW_OP_breg31, DW_OP_breg4, DW_OP_breg5, DW_OP_breg6, DW_OP_breg7, DW_OP_breg8, DW_OP_breg9, DW_OP_bregx, DW_OP_call_frame_cfa, DW_OP_fbreg, DW_OP_reg0, DW_OP_reg1, DW_OP_reg10, DW_OP_reg11, DW_OP_reg12, DW_OP_reg13, DW_OP_reg14, DW_OP_reg15, DW_OP_reg16, DW_OP_reg17, DW_OP_reg18, DW_OP_reg19, DW_OP_reg2, DW_OP_reg20, DW_OP_reg21, DW_OP_reg22, DW_OP_reg23, DW_OP_reg24, DW_OP_reg25, DW_OP_reg26, DW_OP_reg27, DW_OP_reg28, DW_OP_reg29, DW_OP_reg3, DW_OP_reg30, DW_OP_reg31, DW_OP_reg4, DW_OP_reg5, DW_OP_reg6, DW_OP_reg7, DW_OP_reg8, DW_OP_reg9, find_largest_loc_range(), get_dwarf_reg_name(), i, dwarf_var_location_t::kind, dwarf_attr_kind::kind, RzBinDwarfBlock::length, rz_bin_dwarf_loc_list_t::list, LOCATION_BP, LOCATION_GLOBAL, LOCATION_UNKNOWN, NULL, dwarf_var_location_t::offset, capstone::range, dwarf_attr_kind::reference, dwarf_var_location_t::reg_name, dwarf_var_location_t::reg_num, RZ_NEW0, rz_read_ble16(), rz_read_ble32(), rz_read_ble64(), rz_read_ble8(), rz_sleb128(), rz_uleb128(), rz_warn_if_reached, st64, and ut64().
Referenced by parse_function_args_and_vars().
Parses a enum entry into RzBaseType and saves it int Sdb using rz_analysis_save_base_type ()
ctx | |
idx | index of the current entry |
Definition at line 600 of file dwarf_process.c.
References RzBinDwarfDie::abbrev_code, RzBinDwarfDie::attr_values, rz_base_type_enum_t::cases, DW_AT_type, DW_TAG_enumerator, rz_base_type_t::enum_data, find_attr_idx(), free(), get_die_name(), get_die_size(), RzBinDwarfDie::has_children, setup::idx, rz_base_type_t::name, NULL, parse_enumerator(), parse_type_outer(), dwarf_attr_kind::reference, RZ_BASE_TYPE_KIND_ENUM, rz_strbuf_drain_nofree(), rz_strbuf_init(), rz_type_base_enum_case_free(), rz_type_base_type_free(), rz_type_base_type_new(), rz_type_db_save_base_type(), rz_type_parse_string_single(), rz_vector_push(), rz_base_type_t::size, st32, RzBinDwarfDie::tag, type, and rz_base_type_t::type.
Referenced by parse_type_entry().
|
static |
Parses enum entry into *result RzTypeEnumCase http://www.dwarfstd.org/doc/DWARF4.pdf#page=110&zoom=100,0,0.
ctx | |
idx | index of the current entry |
result | ptr to result case to fill up |
Definition at line 478 of file dwarf_process.c.
References dwarf_attr_kind::attr_name, RzBinDwarfDie::attr_values, cleanup(), RzBinDwarfDie::count, DW_AT_const_value, DW_AT_name, free(), get_die_name(), i, setup::idx, int, name, rz_type_enum_case_t::name, NULL, val, rz_type_enum_case_t::val, and value.
Referenced by parse_enum_type().
Parse function,it's arguments, variables and save the information into the Sdb.
ctx | |
idx | Current entry index |
Definition at line 1400 of file dwarf_process.c.
References dwarf_function_t::access, dwarf_function_t::addr, args, dwarf_attr_kind::attr_name, RzBinDwarfDie::attr_values, cleanup(), RzBinDwarfDie::count, DW_AT_accessibility, DW_AT_declaration, DW_AT_entry_pc, DW_AT_external, DW_AT_high_pc, DW_AT_KIND_ADDRESS, DW_AT_KIND_STRING, DW_AT_linkage_name, DW_AT_low_pc, DW_AT_MIPS_linkage_name, DW_AT_name, DW_AT_object_pointer, DW_AT_ranges, DW_AT_specification, DW_AT_trampoline, DW_AT_type, DW_AT_virtuality, DW_AT_vtable_elem_location, find_attr_idx(), free(), get_spec_die_type(), get_specification_die_name(), i, setup::idx, dwarf_function_t::is_external, dwarf_function_t::is_method, dwarf_function_t::is_trampoline, dwarf_function_t::is_virtual, RzStrBuf::len, dwarf_function_t::name, NULL, parse_function_args_and_vars(), parse_type_outer(), prefer_linkage_name(), rz_list_free(), rz_list_new(), rz_str_newf(), rz_strbuf_append(), rz_strbuf_fini(), rz_strbuf_get(), rz_strbuf_init(), rz_warn_if_fail, sdb_save_dwarf_function(), dwarf_function_t::signature, strdup(), ut8, val, variable_free(), and dwarf_function_t::vtable_addr.
Referenced by parse_type_entry().
|
static |
Definition at line 1220 of file dwarf_process.c.
References RzBinDwarfDie::abbrev_code, args, RzBinDwarfDie::attr_values, RzBinDwarfDie::count, DW_AT_abstract_origin, DW_AT_frame_base, DW_AT_linkage_name, DW_AT_location, DW_AT_MIPS_linkage_name, DW_AT_name, DW_AT_type, DW_TAG_formal_parameter, DW_TAG_unspecified_parameters, DW_TAG_variable, find_attr(), RzBinDwarfDie::has_children, i, setup::idx, dwarf_variable_t::location, dwarf_variable_t::name, NULL, parse_abstract_origin(), parse_dwarf_location(), parse_type_outer(), prefer_linkage_name(), rz_list_append(), RZ_NEW0, rz_str_newf(), rz_strbuf_appendf(), rz_strbuf_fini(), rz_strbuf_get(), rz_strbuf_init(), rz_strbuf_slice(), strdup(), RzBinDwarfDie::tag, dwarf_variable_t::type, type, val, and variable_free().
Referenced by parse_function().
|
static |
Parses structured entry into *result RzTypeStructMember http://www.dwarfstd.org/doc/DWARF4.pdf#page=102&zoom=100,0,0.
ctx | |
idx | index of the current entry |
result | ptr to result member to fill up |
Definition at line 392 of file dwarf_process.c.
References dwarf_attr_kind::attr_name, RzBinDwarfDie::attr_values, CHAR_BIT, cleanup(), RzBinDwarfDie::count, DW_AT_accessibility, DW_AT_bit_size, DW_AT_byte_size, DW_AT_containing_type, DW_AT_data_bit_offset, DW_AT_data_member_location, DW_AT_mutable, DW_AT_name, DW_AT_type, free(), get_die_name(), i, setup::idx, name, rz_type_struct_member_t::name, NULL, rz_type_struct_member_t::offset, parse_type_outer(), rz_return_val_if_fail, rz_strbuf_drain_nofree(), rz_strbuf_init(), rz_type_parse_string_single(), rz_type_struct_member_t::size, type, rz_type_struct_member_t::type, ut64(), and value.
Referenced by parse_structure_type().
Parses a structured entry (structs, classes, unions) into RzBaseType and saves it using rz_analysis_save_base_type ()
ctx | |
idx | index of the current entry |
Definition at line 521 of file dwarf_process.c.
References RzBinDwarfDie::abbrev_code, RzBinDwarfDie::attr_values, DW_AT_name, DW_AT_specification, DW_TAG_member, DW_TAG_union_type, find_attr_idx(), free(), get_die_name(), get_die_size(), RzBinDwarfDie::has_children, setup::idx, rz_base_type_struct_t::members, rz_base_type_t::name, NULL, parse_struct_member(), dwarf_attr_kind::reference, RZ_BASE_TYPE_KIND_STRUCT, RZ_BASE_TYPE_KIND_UNION, rz_type_base_type_free(), rz_type_base_type_new(), rz_type_db_save_base_type(), rz_vector_push(), rz_base_type_t::size, st32, rz_base_type_t::struct_data, and RzBinDwarfDie::tag.
Referenced by parse_type_entry().
|
static |
Recursively parses type entry of a certain offset into strbuf saves type size into *size.
ctx | |
offset | offset of the type entry |
strbuf | string to store the type into |
size | ptr to size of a type to fill up (can be NULL if unwanted) |
set | of visited die offsets, to prevent infinite recursion |
TODO make cache for type entries, one type is usually referenced multiple times which means it's parsed multiple times instead of once
Definition at line 258 of file dwarf_process.c.
References RzBinDwarfDie::attr_values, DW_AT_type, DW_TAG_array_type, DW_TAG_base_type, DW_TAG_class_type, DW_TAG_const_type, DW_TAG_enumeration_type, DW_TAG_pointer_type, DW_TAG_reference_type, DW_TAG_restrict_type, DW_TAG_rvalue_reference_type, DW_TAG_structure_type, DW_TAG_subroutine_type, DW_TAG_typedef, DW_TAG_union_type, DW_TAG_volatile_type, find_attr_idx(), free(), get_die_name(), get_die_size(), RzBinDwarfDie::has_children, NULL, parse_array_type(), dwarf_attr_kind::reference, rz_return_val_if_fail, rz_strbuf_append(), set_u_add(), set_u_contains(), set_u_delete(), st32, strbuf_rev_append_char(), strbuf_rev_prepend_char(), RzBinDwarfDie::tag, and test-lz4-versions::tag.
Referenced by parse_type_outer().
Delegates DIE to it's proper parsing method.
ctx | |
idx | index of the current entry |
Definition at line 1565 of file dwarf_process.c.
References DW_TAG_base_type, DW_TAG_class_type, DW_TAG_compile_unit, DW_TAG_enumeration_type, DW_TAG_structure_type, DW_TAG_subprogram, DW_TAG_typedef, DW_TAG_union_type, setup::idx, parse_atomic_type(), parse_comp_unit_lang(), parse_enum_type(), parse_function(), parse_structure_type(), parse_typedef(), rz_return_if_fail, and RzBinDwarfDie::tag.
Referenced by rz_analysis_dwarf_process_info().
|
static |
Convenience function for calling parse_type with an empty visited set See documentation of parse_type.
Definition at line 373 of file dwarf_process.c.
References parse_type(), r, set_u_free(), set_u_new(), and st32.
Referenced by get_spec_die_type(), parse_abstract_origin(), parse_enum_type(), parse_function(), parse_function_args_and_vars(), parse_struct_member(), and parse_typedef().
Parses a typedef entry into RzBaseType and saves it using rz_analysis_save_base_type ()
http://www.dwarfstd.org/doc/DWARF4.pdf#page=96&zoom=100,0,0
ctx | |
idx | index of the current entry |
Definition at line 672 of file dwarf_process.c.
References dwarf_attr_kind::attr_name, RzBinDwarfDie::attr_values, cleanup(), RzBinDwarfDie::count, DW_AT_name, DW_AT_type, free(), get_die_name(), i, setup::idx, name, rz_base_type_t::name, NULL, parse_type_outer(), RZ_BASE_TYPE_KIND_TYPEDEF, rz_strbuf_drain_nofree(), rz_strbuf_fini(), rz_strbuf_init(), rz_type_base_type_free(), rz_type_base_type_new(), rz_type_db_save_base_type(), rz_type_parse_string_single(), type, rz_base_type_t::type, ut64(), and value.
Referenced by parse_type_entry().
|
static |
Definition at line 798 of file dwarf_process.c.
Referenced by parse_abstract_origin(), parse_function(), and parse_function_args_and_vars().
RZ_API void rz_analysis_dwarf_integrate_functions | ( | RzAnalysis * | analysis, |
RzFlag * | flags, | ||
Sdb * | dwarf_sdb | ||
) |
Use parsed DWARF function info from Sdb in the function analysis XXX right now we only save parsed name and variables, we can't use signature now XXX refactor to be more readable.
analysis | |
dwarf_sdb |
Definition at line 1637 of file dwarf_process.c.
References sdb_kv::base, rz_analysis_function_t::bp_off, filter_sdb_function_names(), flags, free(), i, ls_foreach, ls_free(), rz_analysis_function_t::maxstack, NULL, rz_type_db_t::parser, rz_analysis_t::reg, rz_analysis_function_rename(), rz_analysis_function_set_var(), rz_analysis_get_function_at(), rz_flag_set_next(), rz_flag_unset_off(), rz_meta_set_string(), RZ_META_TYPE_COMMENT, rz_reg_get(), rz_return_if_fail, rz_str_newf(), rz_type_free(), rz_type_parse_string_single(), sdb_aforeach, sdb_aforeach_next, sdb_anext(), sdb_foreach_list_filter(), sdb_get(), sdb_num_get(), st64, autogen_x86imm::tmp, type, rz_analysis_t::typedb, and ut64().
Referenced by rz_core_analysis_everything().
RZ_API void rz_analysis_dwarf_process_info | ( | const RzAnalysis * | analysis, |
RzAnalysisDwarfContext * | ctx | ||
) |
Parses type and function information out of DWARF entries and stores them to the sdb for further use.
analysis | |
ctx |
Definition at line 1602 of file dwarf_process.c.
References dwarf_parse_context_t::analysis, RzBinDwarfDie::count, RzBinDwarfCompUnit::count, RzBinDwarfCompUnit::dies, i, info(), NULL, parse_type_entry(), rz_return_if_fail, rz_analysis_t::sdb, and sdb_ns().
Referenced by rz_core_bin_apply_dwarf().
Definition at line 1308 of file dwarf_process.c.
References dwarf_function_t::addr, dwarf_var_location_t::address, free(), key, dwarf_var_location_t::kind, RzStrBuf::len, dwarf_variable_t::location, LOCATION_BP, LOCATION_GLOBAL, LOCATION_REGISTER, LOCATION_SP, dwarf_function_t::name, dwarf_variable_t::name, NULL, dwarf_var_location_t::offset, PFMT64d, PFMT64u, PFMT64x, dwarf_var_location_t::reg_name, rz_str_newf(), rz_str_sanitize_sdb_key(), rz_strbuf_appendf(), rz_strbuf_fini(), rz_strbuf_get(), rz_strbuf_init(), rz_strbuf_slice(), sdb_set(), dwarf_function_t::signature, dwarf_variable_t::type, and val.
Referenced by parse_function().
Pasted from rz_strbuf_* Appends string after a first occurence of character c Used to replicate proper C declaration for function pointers.
sb | |
s | |
needle |
Definition at line 129 of file dwarf_process.c.
References free(), setup::idx, malloc(), memcpy(), NULL, rz_return_val_if_fail, rz_strbuf_set(), s, and sb.
Referenced by parse_type().
Pasted from rz_strbuf_* Prepends string before a last occurence of character c Used to replicate proper C declaration for function pointers.
sb | |
s | |
c |
Definition at line 94 of file dwarf_process.c.
References c, free(), setup::idx, malloc(), memcpy(), NULL, rz_return_val_if_fail, rz_strbuf_set(), s, and sb.
Referenced by parse_type().
|
static |
Definition at line 55 of file dwarf_process.c.
References free(), dwarf_variable_t::location, dwarf_variable_t::name, and dwarf_variable_t::type.
Referenced by parse_function(), and parse_function_args_and_vars().