The FreeRADIUS server $Id: f3670dba8951ca10eb4948feb3dc3db9423a334f $
Loading...
Searching...
No Matches
Data Structures | Macros | Enumerations | Functions
dwarf.c File Reference
#include "config.h"
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include "filenames.h"
#include "backtrace.h"
#include "internal.h"
+ Include dependency graph for dwarf.c:

Go to the source code of this file.

Data Structures

struct  abbrev
 
struct  abbrevs
 
struct  attr
 
struct  attr_val
 
union  attr_val.u
 
struct  dwarf_buf
 
struct  dwarf_data
 
struct  function
 
struct  function_addrs
 
struct  function_vector
 
struct  line
 
struct  line_header
 
struct  line_header_format
 
struct  line_vector
 
struct  pcrange
 
struct  unit
 
struct  unit_addrs
 
struct  unit_addrs_vector
 
struct  unit_vector
 

Macros

#define strnlen   xstrnlen
 

Enumerations

enum  attr_val_encoding {
  ATTR_VAL_NONE ,
  ATTR_VAL_ADDRESS ,
  ATTR_VAL_ADDRESS_INDEX ,
  ATTR_VAL_UINT ,
  ATTR_VAL_SINT ,
  ATTR_VAL_STRING ,
  ATTR_VAL_STRING_INDEX ,
  ATTR_VAL_REF_UNIT ,
  ATTR_VAL_REF_INFO ,
  ATTR_VAL_REF_ALT_INFO ,
  ATTR_VAL_REF_SECTION ,
  ATTR_VAL_REF_TYPE ,
  ATTR_VAL_RNGLISTS_INDEX ,
  ATTR_VAL_BLOCK ,
  ATTR_VAL_EXPR
}
 
enum  dwarf_attribute {
  DW_AT_sibling = 0x01 ,
  DW_AT_location = 0x02 ,
  DW_AT_name = 0x03 ,
  DW_AT_ordering = 0x09 ,
  DW_AT_subscr_data = 0x0a ,
  DW_AT_byte_size = 0x0b ,
  DW_AT_bit_offset = 0x0c ,
  DW_AT_bit_size = 0x0d ,
  DW_AT_element_list = 0x0f ,
  DW_AT_stmt_list = 0x10 ,
  DW_AT_low_pc = 0x11 ,
  DW_AT_high_pc = 0x12 ,
  DW_AT_language = 0x13 ,
  DW_AT_member = 0x14 ,
  DW_AT_discr = 0x15 ,
  DW_AT_discr_value = 0x16 ,
  DW_AT_visibility = 0x17 ,
  DW_AT_import = 0x18 ,
  DW_AT_string_length = 0x19 ,
  DW_AT_common_reference = 0x1a ,
  DW_AT_comp_dir = 0x1b ,
  DW_AT_const_value = 0x1c ,
  DW_AT_containing_type = 0x1d ,
  DW_AT_default_value = 0x1e ,
  DW_AT_inline = 0x20 ,
  DW_AT_is_optional = 0x21 ,
  DW_AT_lower_bound = 0x22 ,
  DW_AT_producer = 0x25 ,
  DW_AT_prototyped = 0x27 ,
  DW_AT_return_addr = 0x2a ,
  DW_AT_start_scope = 0x2c ,
  DW_AT_bit_stride = 0x2e ,
  DW_AT_upper_bound = 0x2f ,
  DW_AT_abstract_origin = 0x31 ,
  DW_AT_accessibility = 0x32 ,
  DW_AT_address_class = 0x33 ,
  DW_AT_artificial = 0x34 ,
  DW_AT_base_types = 0x35 ,
  DW_AT_calling_convention = 0x36 ,
  DW_AT_count = 0x37 ,
  DW_AT_data_member_location = 0x38 ,
  DW_AT_decl_column = 0x39 ,
  DW_AT_decl_file = 0x3a ,
  DW_AT_decl_line = 0x3b ,
  DW_AT_declaration = 0x3c ,
  DW_AT_discr_list = 0x3d ,
  DW_AT_encoding = 0x3e ,
  DW_AT_external = 0x3f ,
  DW_AT_frame_base = 0x40 ,
  DW_AT_friend = 0x41 ,
  DW_AT_identifier_case = 0x42 ,
  DW_AT_macro_info = 0x43 ,
  DW_AT_namelist_items = 0x44 ,
  DW_AT_priority = 0x45 ,
  DW_AT_segment = 0x46 ,
  DW_AT_specification = 0x47 ,
  DW_AT_static_link = 0x48 ,
  DW_AT_type = 0x49 ,
  DW_AT_use_location = 0x4a ,
  DW_AT_variable_parameter = 0x4b ,
  DW_AT_virtuality = 0x4c ,
  DW_AT_vtable_elem_location = 0x4d ,
  DW_AT_allocated = 0x4e ,
  DW_AT_associated = 0x4f ,
  DW_AT_data_location = 0x50 ,
  DW_AT_byte_stride = 0x51 ,
  DW_AT_entry_pc = 0x52 ,
  DW_AT_use_UTF8 = 0x53 ,
  DW_AT_extension = 0x54 ,
  DW_AT_ranges = 0x55 ,
  DW_AT_trampoline = 0x56 ,
  DW_AT_call_column = 0x57 ,
  DW_AT_call_file = 0x58 ,
  DW_AT_call_line = 0x59 ,
  DW_AT_description = 0x5a ,
  DW_AT_binary_scale = 0x5b ,
  DW_AT_decimal_scale = 0x5c ,
  DW_AT_small = 0x5d ,
  DW_AT_decimal_sign = 0x5e ,
  DW_AT_digit_count = 0x5f ,
  DW_AT_picture_string = 0x60 ,
  DW_AT_mutable = 0x61 ,
  DW_AT_threads_scaled = 0x62 ,
  DW_AT_explicit = 0x63 ,
  DW_AT_object_pointer = 0x64 ,
  DW_AT_endianity = 0x65 ,
  DW_AT_elemental = 0x66 ,
  DW_AT_pure = 0x67 ,
  DW_AT_recursive = 0x68 ,
  DW_AT_signature = 0x69 ,
  DW_AT_main_subprogram = 0x6a ,
  DW_AT_data_bit_offset = 0x6b ,
  DW_AT_const_expr = 0x6c ,
  DW_AT_enum_class = 0x6d ,
  DW_AT_linkage_name = 0x6e ,
  DW_AT_string_length_bit_size = 0x6f ,
  DW_AT_string_length_byte_size = 0x70 ,
  DW_AT_rank = 0x71 ,
  DW_AT_str_offsets_base = 0x72 ,
  DW_AT_addr_base = 0x73 ,
  DW_AT_rnglists_base = 0x74 ,
  DW_AT_dwo_name = 0x76 ,
  DW_AT_reference = 0x77 ,
  DW_AT_rvalue_reference = 0x78 ,
  DW_AT_macros = 0x79 ,
  DW_AT_call_all_calls = 0x7a ,
  DW_AT_call_all_source_calls = 0x7b ,
  DW_AT_call_all_tail_calls = 0x7c ,
  DW_AT_call_return_pc = 0x7d ,
  DW_AT_call_value = 0x7e ,
  DW_AT_call_origin = 0x7f ,
  DW_AT_call_parameter = 0x80 ,
  DW_AT_call_pc = 0x81 ,
  DW_AT_call_tail_call = 0x82 ,
  DW_AT_call_target = 0x83 ,
  DW_AT_call_target_clobbered = 0x84 ,
  DW_AT_call_data_location = 0x85 ,
  DW_AT_call_data_value = 0x86 ,
  DW_AT_noreturn = 0x87 ,
  DW_AT_alignment = 0x88 ,
  DW_AT_export_symbols = 0x89 ,
  DW_AT_deleted = 0x8a ,
  DW_AT_defaulted = 0x8b ,
  DW_AT_loclists_base = 0x8c ,
  DW_AT_lo_user = 0x2000 ,
  DW_AT_hi_user = 0x3fff ,
  DW_AT_MIPS_fde = 0x2001 ,
  DW_AT_MIPS_loop_begin = 0x2002 ,
  DW_AT_MIPS_tail_loop_begin = 0x2003 ,
  DW_AT_MIPS_epilog_begin = 0x2004 ,
  DW_AT_MIPS_loop_unroll_factor = 0x2005 ,
  DW_AT_MIPS_software_pipeline_depth = 0x2006 ,
  DW_AT_MIPS_linkage_name = 0x2007 ,
  DW_AT_MIPS_stride = 0x2008 ,
  DW_AT_MIPS_abstract_name = 0x2009 ,
  DW_AT_MIPS_clone_origin = 0x200a ,
  DW_AT_MIPS_has_inlines = 0x200b ,
  DW_AT_HP_block_index = 0x2000 ,
  DW_AT_HP_unmodifiable = 0x2001 ,
  DW_AT_HP_prologue = 0x2005 ,
  DW_AT_HP_epilogue = 0x2008 ,
  DW_AT_HP_actuals_stmt_list = 0x2010 ,
  DW_AT_HP_proc_per_section = 0x2011 ,
  DW_AT_HP_raw_data_ptr = 0x2012 ,
  DW_AT_HP_pass_by_reference = 0x2013 ,
  DW_AT_HP_opt_level = 0x2014 ,
  DW_AT_HP_prof_version_id = 0x2015 ,
  DW_AT_HP_opt_flags = 0x2016 ,
  DW_AT_HP_cold_region_low_pc = 0x2017 ,
  DW_AT_HP_cold_region_high_pc = 0x2018 ,
  DW_AT_HP_all_variables_modifiable = 0x2019 ,
  DW_AT_HP_linkage_name = 0x201a ,
  DW_AT_HP_prof_flags = 0x201b ,
  DW_AT_HP_unit_name = 0x201f ,
  DW_AT_HP_unit_size = 0x2020 ,
  DW_AT_HP_widened_byte_size = 0x2021 ,
  DW_AT_HP_definition_points = 0x2022 ,
  DW_AT_HP_default_location = 0x2023 ,
  DW_AT_HP_is_result_param = 0x2029 ,
  DW_AT_sf_names = 0x2101 ,
  DW_AT_src_info = 0x2102 ,
  DW_AT_mac_info = 0x2103 ,
  DW_AT_src_coords = 0x2104 ,
  DW_AT_body_begin = 0x2105 ,
  DW_AT_body_end = 0x2106 ,
  DW_AT_GNU_vector = 0x2107 ,
  DW_AT_GNU_guarded_by = 0x2108 ,
  DW_AT_GNU_pt_guarded_by = 0x2109 ,
  DW_AT_GNU_guarded = 0x210a ,
  DW_AT_GNU_pt_guarded = 0x210b ,
  DW_AT_GNU_locks_excluded = 0x210c ,
  DW_AT_GNU_exclusive_locks_required = 0x210d ,
  DW_AT_GNU_shared_locks_required = 0x210e ,
  DW_AT_GNU_odr_signature = 0x210f ,
  DW_AT_GNU_template_name = 0x2110 ,
  DW_AT_GNU_call_site_value = 0x2111 ,
  DW_AT_GNU_call_site_data_value = 0x2112 ,
  DW_AT_GNU_call_site_target = 0x2113 ,
  DW_AT_GNU_call_site_target_clobbered = 0x2114 ,
  DW_AT_GNU_tail_call = 0x2115 ,
  DW_AT_GNU_all_tail_call_sites = 0x2116 ,
  DW_AT_GNU_all_call_sites = 0x2117 ,
  DW_AT_GNU_all_source_call_sites = 0x2118 ,
  DW_AT_GNU_macros = 0x2119 ,
  DW_AT_GNU_deleted = 0x211a ,
  DW_AT_GNU_dwo_name = 0x2130 ,
  DW_AT_GNU_dwo_id = 0x2131 ,
  DW_AT_GNU_ranges_base = 0x2132 ,
  DW_AT_GNU_addr_base = 0x2133 ,
  DW_AT_GNU_pubnames = 0x2134 ,
  DW_AT_GNU_pubtypes = 0x2135 ,
  DW_AT_GNU_discriminator = 0x2136 ,
  DW_AT_GNU_locviews = 0x2137 ,
  DW_AT_GNU_entry_view = 0x2138 ,
  DW_AT_VMS_rtnbeg_pd_address = 0x2201 ,
  DW_AT_use_GNAT_descriptive_type = 0x2301 ,
  DW_AT_GNAT_descriptive_type = 0x2302 ,
  DW_AT_GNU_numerator = 0x2303 ,
  DW_AT_GNU_denominator = 0x2304 ,
  DW_AT_GNU_bias = 0x2305 ,
  DW_AT_upc_threads_scaled = 0x3210 ,
  DW_AT_PGI_lbase = 0x3a00 ,
  DW_AT_PGI_soffset = 0x3a01 ,
  DW_AT_PGI_lstride = 0x3a02 ,
  DW_AT_APPLE_optimized = 0x3fe1 ,
  DW_AT_APPLE_flags = 0x3fe2 ,
  DW_AT_APPLE_isa = 0x3fe3 ,
  DW_AT_APPLE_block = 0x3fe4 ,
  DW_AT_APPLE_major_runtime_vers = 0x3fe5 ,
  DW_AT_APPLE_runtime_class = 0x3fe6 ,
  DW_AT_APPLE_omit_frame_ptr = 0x3fe7 ,
  DW_AT_APPLE_property_name = 0x3fe8 ,
  DW_AT_APPLE_property_getter = 0x3fe9 ,
  DW_AT_APPLE_property_setter = 0x3fea ,
  DW_AT_APPLE_property_attribute = 0x3feb ,
  DW_AT_APPLE_objc_complete_type = 0x3fec ,
  DW_AT_APPLE_property = 0x3fed
}
 
enum  dwarf_extended_line_number_op {
  DW_LNE_end_sequence = 0x1 ,
  DW_LNE_set_address = 0x2 ,
  DW_LNE_define_file = 0x3 ,
  DW_LNE_set_discriminator = 0x4
}
 
enum  dwarf_form {
  DW_FORM_addr = 0x01 ,
  DW_FORM_block2 = 0x03 ,
  DW_FORM_block4 = 0x04 ,
  DW_FORM_data2 = 0x05 ,
  DW_FORM_data4 = 0x06 ,
  DW_FORM_data8 = 0x07 ,
  DW_FORM_string = 0x08 ,
  DW_FORM_block = 0x09 ,
  DW_FORM_block1 = 0x0a ,
  DW_FORM_data1 = 0x0b ,
  DW_FORM_flag = 0x0c ,
  DW_FORM_sdata = 0x0d ,
  DW_FORM_strp = 0x0e ,
  DW_FORM_udata = 0x0f ,
  DW_FORM_ref_addr = 0x10 ,
  DW_FORM_ref1 = 0x11 ,
  DW_FORM_ref2 = 0x12 ,
  DW_FORM_ref4 = 0x13 ,
  DW_FORM_ref8 = 0x14 ,
  DW_FORM_ref_udata = 0x15 ,
  DW_FORM_indirect = 0x16 ,
  DW_FORM_sec_offset = 0x17 ,
  DW_FORM_exprloc = 0x18 ,
  DW_FORM_flag_present = 0x19 ,
  DW_FORM_ref_sig8 = 0x20 ,
  DW_FORM_strx = 0x1a ,
  DW_FORM_addrx = 0x1b ,
  DW_FORM_ref_sup4 = 0x1c ,
  DW_FORM_strp_sup = 0x1d ,
  DW_FORM_data16 = 0x1e ,
  DW_FORM_line_strp = 0x1f ,
  DW_FORM_implicit_const = 0x21 ,
  DW_FORM_loclistx = 0x22 ,
  DW_FORM_rnglistx = 0x23 ,
  DW_FORM_ref_sup8 = 0x24 ,
  DW_FORM_strx1 = 0x25 ,
  DW_FORM_strx2 = 0x26 ,
  DW_FORM_strx3 = 0x27 ,
  DW_FORM_strx4 = 0x28 ,
  DW_FORM_addrx1 = 0x29 ,
  DW_FORM_addrx2 = 0x2a ,
  DW_FORM_addrx3 = 0x2b ,
  DW_FORM_addrx4 = 0x2c ,
  DW_FORM_GNU_addr_index = 0x1f01 ,
  DW_FORM_GNU_str_index = 0x1f02 ,
  DW_FORM_GNU_ref_alt = 0x1f20 ,
  DW_FORM_GNU_strp_alt = 0x1f21
}
 
enum  dwarf_line_number_content_type {
  DW_LNCT_path = 0x1 ,
  DW_LNCT_directory_index = 0x2 ,
  DW_LNCT_timestamp = 0x3 ,
  DW_LNCT_size = 0x4 ,
  DW_LNCT_MD5 = 0x5 ,
  DW_LNCT_lo_user = 0x2000 ,
  DW_LNCT_hi_user = 0x3fff
}
 
enum  dwarf_line_number_op {
  DW_LNS_extended_op = 0x0 ,
  DW_LNS_copy = 0x1 ,
  DW_LNS_advance_pc = 0x2 ,
  DW_LNS_advance_line = 0x3 ,
  DW_LNS_set_file = 0x4 ,
  DW_LNS_set_column = 0x5 ,
  DW_LNS_negate_stmt = 0x6 ,
  DW_LNS_set_basic_block = 0x7 ,
  DW_LNS_const_add_pc = 0x8 ,
  DW_LNS_fixed_advance_pc = 0x9 ,
  DW_LNS_set_prologue_end = 0xa ,
  DW_LNS_set_epilogue_begin = 0xb ,
  DW_LNS_set_isa = 0xc
}
 
enum  dwarf_range_list_entry {
  DW_RLE_end_of_list = 0x00 ,
  DW_RLE_base_addressx = 0x01 ,
  DW_RLE_startx_endx = 0x02 ,
  DW_RLE_startx_length = 0x03 ,
  DW_RLE_offset_pair = 0x04 ,
  DW_RLE_base_address = 0x05 ,
  DW_RLE_start_end = 0x06 ,
  DW_RLE_start_length = 0x07
}
 
enum  dwarf_tag {
  DW_TAG_entry_point = 0x3 ,
  DW_TAG_compile_unit = 0x11 ,
  DW_TAG_inlined_subroutine = 0x1d ,
  DW_TAG_subprogram = 0x2e ,
  DW_TAG_skeleton_unit = 0x4a
}
 
enum  dwarf_unit_type {
  DW_UT_compile = 0x01 ,
  DW_UT_type = 0x02 ,
  DW_UT_partial = 0x03 ,
  DW_UT_skeleton = 0x04 ,
  DW_UT_split_compile = 0x05 ,
  DW_UT_split_type = 0x06 ,
  DW_UT_lo_user = 0x80 ,
  DW_UT_hi_user = 0xff
}
 

Functions

static int abbrev_compare (const void *v1, const void *v2)
 
static int add_function_range (struct backtrace_state *state, void *rdata, uintptr_t lowpc, uintptr_t highpc, backtrace_error_callback error_callback, void *data, void *pvec)
 
static int add_line (struct backtrace_state *state, struct dwarf_data *ddata, uintptr_t pc, const char *filename, int lineno, backtrace_error_callback error_callback, void *data, struct line_vector *vec)
 
static int add_low_high_range (struct backtrace_state *state, const struct dwarf_sections *dwarf_sections, struct libbacktrace_base_address base_address, int is_bigendian, struct unit *u, const struct pcrange *pcrange, int(*add_range)(struct backtrace_state *state, void *rdata, uintptr_t lowpc, uintptr_t highpc, backtrace_error_callback error_callback, void *data, void *vec), void *rdata, backtrace_error_callback error_callback, void *data, void *vec)
 
static int add_ranges (struct backtrace_state *state, const struct dwarf_sections *dwarf_sections, struct libbacktrace_base_address base_address, int is_bigendian, struct unit *u, uintptr_t base, const struct pcrange *pcrange, int(*add_range)(struct backtrace_state *state, void *rdata, uintptr_t lowpc, uintptr_t highpc, backtrace_error_callback error_callback, void *data, void *vec), void *rdata, backtrace_error_callback error_callback, void *data, void *vec)
 
static int add_ranges_from_ranges (struct backtrace_state *state, const struct dwarf_sections *dwarf_sections, struct libbacktrace_base_address base_address, int is_bigendian, struct unit *u, uintptr_t base, const struct pcrange *pcrange, int(*add_range)(struct backtrace_state *state, void *rdata, uintptr_t lowpc, uintptr_t highpc, backtrace_error_callback error_callback, void *data, void *vec), void *rdata, backtrace_error_callback error_callback, void *data, void *vec)
 
static int add_ranges_from_rnglists (struct backtrace_state *state, const struct dwarf_sections *dwarf_sections, struct libbacktrace_base_address base_address, int is_bigendian, struct unit *u, uintptr_t base, const struct pcrange *pcrange, int(*add_range)(struct backtrace_state *state, void *rdata, uintptr_t lowpc, uintptr_t highpc, backtrace_error_callback error_callback, void *data, void *vec), void *rdata, backtrace_error_callback error_callback, void *data, void *vec)
 
static int add_unit_addr (struct backtrace_state *state, void *rdata, uintptr_t lowpc, uintptr_t highpc, backtrace_error_callback error_callback, void *data, void *pvec)
 
static int advance (struct dwarf_buf *buf, size_t count)
 
int backtrace_dwarf_add (struct backtrace_state *state, struct libbacktrace_base_address base_address, const struct dwarf_sections *dwarf_sections, int is_bigendian, struct dwarf_data *fileline_altlink, backtrace_error_callback error_callback, void *data, fileline *fileline_fn, struct dwarf_data **fileline_entry)
 
static int build_address_map (struct backtrace_state *state, struct libbacktrace_base_address base_address, const struct dwarf_sections *dwarf_sections, int is_bigendian, struct dwarf_data *altlink, backtrace_error_callback error_callback, void *data, struct unit_addrs_vector *addrs, struct unit_vector *unit_vec)
 
static struct dwarf_databuild_dwarf_data (struct backtrace_state *state, struct libbacktrace_base_address base_address, const struct dwarf_sections *dwarf_sections, int is_bigendian, struct dwarf_data *altlink, backtrace_error_callback error_callback, void *data)
 
static void dwarf_buf_error (struct dwarf_buf *buf, const char *msg, int errnum)
 
static int dwarf_fileline (struct backtrace_state *state, uintptr_t pc, backtrace_full_callback callback, backtrace_error_callback error_callback, void *data)
 
static int dwarf_lookup_pc (struct backtrace_state *state, struct dwarf_data *ddata, uintptr_t pc, backtrace_full_callback callback, backtrace_error_callback error_callback, void *data, int *found)
 
static int find_address_ranges (struct backtrace_state *state, struct libbacktrace_base_address base_address, struct dwarf_buf *unit_buf, const struct dwarf_sections *dwarf_sections, int is_bigendian, struct dwarf_data *altlink, backtrace_error_callback error_callback, void *data, struct unit *u, struct unit_addrs_vector *addrs, enum dwarf_tag *unit_tag)
 
static struct unitfind_unit (struct unit **pu, size_t units_count, size_t offset)
 
static void free_abbrevs (struct backtrace_state *state, struct abbrevs *abbrevs, backtrace_error_callback error_callback, void *data)
 
static void free_line_header (struct backtrace_state *state, struct line_header *hdr, backtrace_error_callback error_callback, void *data)
 
static int function_addrs_compare (const void *v1, const void *v2)
 
static int function_addrs_search (const void *vkey, const void *ventry)
 
static int is_highest_address (uint64_t address, int addrsize)
 
static size_t leb128_len (const unsigned char *p)
 
static int line_compare (const void *v1, const void *v2)
 
static int line_search (const void *vkey, const void *ventry)
 
static const struct abbrevlookup_abbrev (struct abbrevs *abbrevs, uint64_t code, backtrace_error_callback error_callback, void *data)
 
static int read_abbrevs (struct backtrace_state *state, uint64_t abbrev_offset, const unsigned char *dwarf_abbrev, size_t dwarf_abbrev_size, int is_bigendian, backtrace_error_callback error_callback, void *data, struct abbrevs *abbrevs)
 
static uint64_t read_address (struct dwarf_buf *buf, int addrsize)
 
static int read_attribute (enum dwarf_form form, uint64_t implicit_val, struct dwarf_buf *buf, int is_dwarf64, int version, int addrsize, const struct dwarf_sections *dwarf_sections, struct dwarf_data *altlink, struct attr_val *val)
 
static unsigned char read_byte (struct dwarf_buf *buf)
 
static int read_function_entry (struct backtrace_state *state, struct dwarf_data *ddata, struct unit *u, uintptr_t base, struct dwarf_buf *unit_buf, const struct line_header *lhdr, backtrace_error_callback error_callback, void *data, struct function_vector *vec_function, struct function_vector *vec_inlined)
 
static void read_function_info (struct backtrace_state *state, struct dwarf_data *ddata, const struct line_header *lhdr, backtrace_error_callback error_callback, void *data, struct unit *u, struct function_vector *fvec, struct function_addrs **ret_addrs, size_t *ret_addrs_count)
 
static uint64_t read_initial_length (struct dwarf_buf *buf, int *is_dwarf64)
 
static int read_line_header (struct backtrace_state *state, struct dwarf_data *ddata, struct unit *u, int is_dwarf64, struct dwarf_buf *line_buf, struct line_header *hdr)
 
static int read_line_header_format_entries (struct backtrace_state *state, struct dwarf_data *ddata, struct unit *u, struct dwarf_buf *hdr_buf, struct line_header *hdr, size_t *pcount, const char ***ppaths)
 
static int read_line_info (struct backtrace_state *state, struct dwarf_data *ddata, backtrace_error_callback error_callback, void *data, struct unit *u, struct line_header *hdr, struct line **lines, size_t *lines_count)
 
static int read_line_program (struct backtrace_state *state, struct dwarf_data *ddata, const struct line_header *hdr, struct dwarf_buf *line_buf, struct line_vector *vec)
 
static int read_lnct (struct backtrace_state *state, struct dwarf_data *ddata, struct unit *u, struct dwarf_buf *hdr_buf, const struct line_header *hdr, size_t formats_count, const struct line_header_format *formats, const char **string)
 
static uint64_t read_offset (struct dwarf_buf *buf, int is_dwarf64)
 
static const char * read_referenced_name (struct dwarf_data *, struct unit *, uint64_t, backtrace_error_callback, void *)
 
static const char * read_referenced_name_from_attr (struct dwarf_data *ddata, struct unit *u, struct attr *attr, struct attr_val *val, backtrace_error_callback error_callback, void *data)
 
static signed char read_sbyte (struct dwarf_buf *buf)
 
static int64_t read_sleb128 (struct dwarf_buf *buf)
 
static const char * read_string (struct dwarf_buf *buf)
 
static uint16_t read_uint16 (struct dwarf_buf *buf)
 
static uint32_t read_uint24 (struct dwarf_buf *buf)
 
static uint32_t read_uint32 (struct dwarf_buf *buf)
 
static uint64_t read_uint64 (struct dwarf_buf *buf)
 
static uint64_t read_uleb128 (struct dwarf_buf *buf)
 
static int read_v2_paths (struct backtrace_state *state, struct unit *u, struct dwarf_buf *hdr_buf, struct line_header *hdr)
 
static int report_inlined_functions (uintptr_t pc, struct function *function, backtrace_full_callback callback, void *data, const char **filename, int *lineno)
 
static int require (struct dwarf_buf *buf, size_t count)
 
static int resolve_addr_index (const struct dwarf_sections *dwarf_sections, uint64_t addr_base, int addrsize, int is_bigendian, uint64_t addr_index, backtrace_error_callback error_callback, void *data, uintptr_t *address)
 
static int resolve_string (const struct dwarf_sections *dwarf_sections, int is_dwarf64, int is_bigendian, uint64_t str_offsets_base, const struct attr_val *val, backtrace_error_callback error_callback, void *data, const char **string)
 
static int resolve_unit_addrs_overlap (struct backtrace_state *state, backtrace_error_callback error_callback, void *data, struct unit_addrs_vector *addrs_vec)
 
static int resolve_unit_addrs_overlap_walk (struct backtrace_state *state, size_t *pfrom, size_t *pto, struct unit_addrs *enclosing, struct unit_addrs_vector *old_vec, backtrace_error_callback error_callback, void *data, struct unit_addrs_vector *new_vec)
 
static int unit_addrs_compare (const void *v1, const void *v2)
 
static int unit_addrs_search (const void *vkey, const void *ventry)
 
static int units_search (const void *vkey, const void *ventry)
 
static void update_pcrange (const struct attr *attr, const struct attr_val *val, struct pcrange *pcrange)
 
static size_t xstrnlen (const char *s, size_t maxlen)
 

Data Structure Documentation

◆ abbrev

struct abbrev

Definition at line 435 of file dwarf.c.

+ Collaboration diagram for abbrev:
Data Fields
struct attr * attrs
uint64_t code
int has_children
size_t num_attrs
enum dwarf_tag tag

◆ abbrevs

struct abbrevs

Definition at line 456 of file dwarf.c.

+ Collaboration diagram for abbrevs:
Data Fields
struct abbrev * abbrevs
size_t num_abbrevs

◆ attr

struct attr

Definition at line 423 of file dwarf.c.

Data Fields
enum dwarf_form form
enum dwarf_attribute name
int64_t val

◆ attr_val

struct attr_val

Definition at line 503 of file dwarf.c.

Data Fields
enum attr_val_encoding encoding
union attr_val.u u

◆ attr_val.u

union attr_val.u

Definition at line 507 of file dwarf.c.

Data Fields
int64_t sint
const char * string
uint64_t uint

◆ dwarf_buf

struct dwarf_buf

Definition at line 401 of file dwarf.c.

Data Fields
const unsigned char * buf
void * data
backtrace_error_callback error_callback
int is_bigendian
size_t left
const char * name
int reported_underflow
const unsigned char * start

◆ dwarf_data

struct dwarf_data

Definition at line 719 of file dwarf.c.

+ Collaboration diagram for dwarf_data:
Data Fields
struct unit_addrs * addrs
size_t addrs_count
struct dwarf_data * altlink
struct libbacktrace_base_address base_address
struct dwarf_sections dwarf_sections
struct function_vector fvec
int is_bigendian
struct dwarf_data * next
struct unit ** units
size_t units_count

◆ function

struct function

Definition at line 590 of file dwarf.c.

+ Collaboration diagram for function:
Data Fields
const char * caller_filename
int caller_lineno
struct function_addrs * function_addrs
size_t function_addrs_count
const char * name

◆ function_addrs

struct function_addrs

Definition at line 608 of file dwarf.c.

+ Collaboration diagram for function_addrs:
Data Fields
struct function * function
uintptr_t high
uintptr_t low

◆ function_vector

struct function_vector

Definition at line 619 of file dwarf.c.

+ Collaboration diagram for function_vector:
Data Fields
size_t count
struct backtrace_vector vec

◆ line

struct line

Definition at line 562 of file dwarf.c.

Data Fields
const char * filename
int idx
int lineno
uintptr_t pc

◆ line_header

struct line_header

Definition at line 521 of file dwarf.c.

Data Fields
int addrsize
const char ** dirs
size_t dirs_count
const char ** filenames
size_t filenames_count
int line_base
unsigned int line_range
unsigned int max_ops_per_insn
unsigned int min_insn_len
unsigned int opcode_base
const unsigned char * opcode_lengths
int version

◆ line_header_format

struct line_header_format

Definition at line 551 of file dwarf.c.

Data Fields
enum dwarf_form form
int lnct

◆ line_vector

struct line_vector

Definition at line 580 of file dwarf.c.

+ Collaboration diagram for line_vector:
Data Fields
size_t count
struct backtrace_vector vec

◆ pcrange

struct pcrange

Definition at line 2054 of file dwarf.c.

Data Fields
int have_highpc
int have_lowpc
int have_ranges
uintptr_t highpc
int highpc_is_addr_index
int highpc_is_relative
uintptr_t lowpc
int lowpc_is_addr_index
uint64_t ranges
int ranges_is_index

◆ unit

struct unit

Definition at line 630 of file dwarf.c.

+ Collaboration diagram for unit:
Data Fields
struct abbrevs abbrevs
const char * abs_filename
uint64_t addr_base
int addrsize
const char * comp_dir
const char * filename
struct function_addrs * function_addrs
size_t function_addrs_count
size_t high_offset
int is_dwarf64
off_t lineoff
struct line * lines
size_t lines_count
size_t low_offset
uint64_t rnglists_base
uint64_t str_offsets_base
const unsigned char * unit_data
size_t unit_data_len
size_t unit_data_offset
int version

◆ unit_addrs

struct unit_addrs

Definition at line 690 of file dwarf.c.

+ Collaboration diagram for unit_addrs:
Data Fields
uintptr_t high
uintptr_t low
struct unit * u

◆ unit_addrs_vector

struct unit_addrs_vector

Definition at line 701 of file dwarf.c.

+ Collaboration diagram for unit_addrs_vector:
Data Fields
size_t count
struct backtrace_vector vec

◆ unit_vector

struct unit_vector

Definition at line 711 of file dwarf.c.

+ Collaboration diagram for unit_vector:
Data Fields
size_t count
struct backtrace_vector vec

Macro Definition Documentation

◆ strnlen

#define strnlen   xstrnlen

Definition at line 395 of file dwarf.c.

Enumeration Type Documentation

◆ attr_val_encoding

Enumerator
ATTR_VAL_NONE 
ATTR_VAL_ADDRESS 
ATTR_VAL_ADDRESS_INDEX 
ATTR_VAL_UINT 
ATTR_VAL_SINT 
ATTR_VAL_STRING 
ATTR_VAL_STRING_INDEX 
ATTR_VAL_REF_UNIT 
ATTR_VAL_REF_INFO 
ATTR_VAL_REF_ALT_INFO 
ATTR_VAL_REF_SECTION 
ATTR_VAL_REF_TYPE 
ATTR_VAL_RNGLISTS_INDEX 
ATTR_VAL_BLOCK 
ATTR_VAL_EXPR 

Definition at line 466 of file dwarf.c.

◆ dwarf_attribute

Enumerator
DW_AT_sibling 
DW_AT_location 
DW_AT_name 
DW_AT_ordering 
DW_AT_subscr_data 
DW_AT_byte_size 
DW_AT_bit_offset 
DW_AT_bit_size 
DW_AT_element_list 
DW_AT_stmt_list 
DW_AT_low_pc 
DW_AT_high_pc 
DW_AT_language 
DW_AT_member 
DW_AT_discr 
DW_AT_discr_value 
DW_AT_visibility 
DW_AT_import 
DW_AT_string_length 
DW_AT_common_reference 
DW_AT_comp_dir 
DW_AT_const_value 
DW_AT_containing_type 
DW_AT_default_value 
DW_AT_inline 
DW_AT_is_optional 
DW_AT_lower_bound 
DW_AT_producer 
DW_AT_prototyped 
DW_AT_return_addr 
DW_AT_start_scope 
DW_AT_bit_stride 
DW_AT_upper_bound 
DW_AT_abstract_origin 
DW_AT_accessibility 
DW_AT_address_class 
DW_AT_artificial 
DW_AT_base_types 
DW_AT_calling_convention 
DW_AT_count 
DW_AT_data_member_location 
DW_AT_decl_column 
DW_AT_decl_file 
DW_AT_decl_line 
DW_AT_declaration 
DW_AT_discr_list 
DW_AT_encoding 
DW_AT_external 
DW_AT_frame_base 
DW_AT_friend 
DW_AT_identifier_case 
DW_AT_macro_info 
DW_AT_namelist_items 
DW_AT_priority 
DW_AT_segment 
DW_AT_specification 
DW_AT_static_link 
DW_AT_type 
DW_AT_use_location 
DW_AT_variable_parameter 
DW_AT_virtuality 
DW_AT_vtable_elem_location 
DW_AT_allocated 
DW_AT_associated 
DW_AT_data_location 
DW_AT_byte_stride 
DW_AT_entry_pc 
DW_AT_use_UTF8 
DW_AT_extension 
DW_AT_ranges 
DW_AT_trampoline 
DW_AT_call_column 
DW_AT_call_file 
DW_AT_call_line 
DW_AT_description 
DW_AT_binary_scale 
DW_AT_decimal_scale 
DW_AT_small 
DW_AT_decimal_sign 
DW_AT_digit_count 
DW_AT_picture_string 
DW_AT_mutable 
DW_AT_threads_scaled 
DW_AT_explicit 
DW_AT_object_pointer 
DW_AT_endianity 
DW_AT_elemental 
DW_AT_pure 
DW_AT_recursive 
DW_AT_signature 
DW_AT_main_subprogram 
DW_AT_data_bit_offset 
DW_AT_const_expr 
DW_AT_enum_class 
DW_AT_linkage_name 
DW_AT_string_length_bit_size 
DW_AT_string_length_byte_size 
DW_AT_rank 
DW_AT_str_offsets_base 
DW_AT_addr_base 
DW_AT_rnglists_base 
DW_AT_dwo_name 
DW_AT_reference 
DW_AT_rvalue_reference 
DW_AT_macros 
DW_AT_call_all_calls 
DW_AT_call_all_source_calls 
DW_AT_call_all_tail_calls 
DW_AT_call_return_pc 
DW_AT_call_value 
DW_AT_call_origin 
DW_AT_call_parameter 
DW_AT_call_pc 
DW_AT_call_tail_call 
DW_AT_call_target 
DW_AT_call_target_clobbered 
DW_AT_call_data_location 
DW_AT_call_data_value 
DW_AT_noreturn 
DW_AT_alignment 
DW_AT_export_symbols 
DW_AT_deleted 
DW_AT_defaulted 
DW_AT_loclists_base 
DW_AT_lo_user 
DW_AT_hi_user 
DW_AT_MIPS_fde 
DW_AT_MIPS_loop_begin 
DW_AT_MIPS_tail_loop_begin 
DW_AT_MIPS_epilog_begin 
DW_AT_MIPS_loop_unroll_factor 
DW_AT_MIPS_software_pipeline_depth 
DW_AT_MIPS_linkage_name 
DW_AT_MIPS_stride 
DW_AT_MIPS_abstract_name 
DW_AT_MIPS_clone_origin 
DW_AT_MIPS_has_inlines 
DW_AT_HP_block_index 
DW_AT_HP_unmodifiable 
DW_AT_HP_prologue 
DW_AT_HP_epilogue 
DW_AT_HP_actuals_stmt_list 
DW_AT_HP_proc_per_section 
DW_AT_HP_raw_data_ptr 
DW_AT_HP_pass_by_reference 
DW_AT_HP_opt_level 
DW_AT_HP_prof_version_id 
DW_AT_HP_opt_flags 
DW_AT_HP_cold_region_low_pc 
DW_AT_HP_cold_region_high_pc 
DW_AT_HP_all_variables_modifiable 
DW_AT_HP_linkage_name 
DW_AT_HP_prof_flags 
DW_AT_HP_unit_name 
DW_AT_HP_unit_size 
DW_AT_HP_widened_byte_size 
DW_AT_HP_definition_points 
DW_AT_HP_default_location 
DW_AT_HP_is_result_param 
DW_AT_sf_names 
DW_AT_src_info 
DW_AT_mac_info 
DW_AT_src_coords 
DW_AT_body_begin 
DW_AT_body_end 
DW_AT_GNU_vector 
DW_AT_GNU_guarded_by 
DW_AT_GNU_pt_guarded_by 
DW_AT_GNU_guarded 
DW_AT_GNU_pt_guarded 
DW_AT_GNU_locks_excluded 
DW_AT_GNU_exclusive_locks_required 
DW_AT_GNU_shared_locks_required 
DW_AT_GNU_odr_signature 
DW_AT_GNU_template_name 
DW_AT_GNU_call_site_value 
DW_AT_GNU_call_site_data_value 
DW_AT_GNU_call_site_target 
DW_AT_GNU_call_site_target_clobbered 
DW_AT_GNU_tail_call 
DW_AT_GNU_all_tail_call_sites 
DW_AT_GNU_all_call_sites 
DW_AT_GNU_all_source_call_sites 
DW_AT_GNU_macros 
DW_AT_GNU_deleted 
DW_AT_GNU_dwo_name 
DW_AT_GNU_dwo_id 
DW_AT_GNU_ranges_base 
DW_AT_GNU_addr_base 
DW_AT_GNU_pubnames 
DW_AT_GNU_pubtypes 
DW_AT_GNU_discriminator 
DW_AT_GNU_locviews 
DW_AT_GNU_entry_view 
DW_AT_VMS_rtnbeg_pd_address 
DW_AT_use_GNAT_descriptive_type 
DW_AT_GNAT_descriptive_type 
DW_AT_GNU_numerator 
DW_AT_GNU_denominator 
DW_AT_GNU_bias 
DW_AT_upc_threads_scaled 
DW_AT_PGI_lbase 
DW_AT_PGI_soffset 
DW_AT_PGI_lstride 
DW_AT_APPLE_optimized 
DW_AT_APPLE_flags 
DW_AT_APPLE_isa 
DW_AT_APPLE_block 
DW_AT_APPLE_major_runtime_vers 
DW_AT_APPLE_runtime_class 
DW_AT_APPLE_omit_frame_ptr 
DW_AT_APPLE_property_name 
DW_AT_APPLE_property_getter 
DW_AT_APPLE_property_setter 
DW_AT_APPLE_property_attribute 
DW_AT_APPLE_objc_complete_type 
DW_AT_APPLE_property 

Definition at line 105 of file dwarf.c.

◆ dwarf_extended_line_number_op

Enumerator
DW_LNE_end_sequence 
DW_LNE_set_address 
DW_LNE_define_file 
DW_LNE_set_discriminator 

Definition at line 341 of file dwarf.c.

◆ dwarf_form

enum dwarf_form
Enumerator
DW_FORM_addr 
DW_FORM_block2 
DW_FORM_block4 
DW_FORM_data2 
DW_FORM_data4 
DW_FORM_data8 
DW_FORM_string 
DW_FORM_block 
DW_FORM_block1 
DW_FORM_data1 
DW_FORM_flag 
DW_FORM_sdata 
DW_FORM_strp 
DW_FORM_udata 
DW_FORM_ref_addr 
DW_FORM_ref1 
DW_FORM_ref2 
DW_FORM_ref4 
DW_FORM_ref8 
DW_FORM_ref_udata 
DW_FORM_indirect 
DW_FORM_sec_offset 
DW_FORM_exprloc 
DW_FORM_flag_present 
DW_FORM_ref_sig8 
DW_FORM_strx 
DW_FORM_addrx 
DW_FORM_ref_sup4 
DW_FORM_strp_sup 
DW_FORM_data16 
DW_FORM_line_strp 
DW_FORM_implicit_const 
DW_FORM_loclistx 
DW_FORM_rnglistx 
DW_FORM_ref_sup8 
DW_FORM_strx1 
DW_FORM_strx2 
DW_FORM_strx3 
DW_FORM_strx4 
DW_FORM_addrx1 
DW_FORM_addrx2 
DW_FORM_addrx3 
DW_FORM_addrx4 
DW_FORM_GNU_addr_index 
DW_FORM_GNU_str_index 
DW_FORM_GNU_ref_alt 
DW_FORM_GNU_strp_alt 

Definition at line 55 of file dwarf.c.

◆ dwarf_line_number_content_type

Enumerator
DW_LNCT_path 
DW_LNCT_directory_index 
DW_LNCT_timestamp 
DW_LNCT_size 
DW_LNCT_MD5 
DW_LNCT_lo_user 
DW_LNCT_hi_user 

Definition at line 348 of file dwarf.c.

◆ dwarf_line_number_op

Enumerator
DW_LNS_extended_op 
DW_LNS_copy 
DW_LNS_advance_pc 
DW_LNS_advance_line 
DW_LNS_set_file 
DW_LNS_set_column 
DW_LNS_negate_stmt 
DW_LNS_set_basic_block 
DW_LNS_const_add_pc 
DW_LNS_fixed_advance_pc 
DW_LNS_set_prologue_end 
DW_LNS_set_epilogue_begin 
DW_LNS_set_isa 

Definition at line 325 of file dwarf.c.

◆ dwarf_range_list_entry

Enumerator
DW_RLE_end_of_list 
DW_RLE_base_addressx 
DW_RLE_startx_endx 
DW_RLE_startx_length 
DW_RLE_offset_pair 
DW_RLE_base_address 
DW_RLE_start_end 
DW_RLE_start_length 

Definition at line 358 of file dwarf.c.

◆ dwarf_tag

enum dwarf_tag
Enumerator
DW_TAG_entry_point 
DW_TAG_compile_unit 
DW_TAG_inlined_subroutine 
DW_TAG_subprogram 
DW_TAG_skeleton_unit 

Definition at line 47 of file dwarf.c.

◆ dwarf_unit_type

Enumerator
DW_UT_compile 
DW_UT_type 
DW_UT_partial 
DW_UT_skeleton 
DW_UT_split_compile 
DW_UT_split_type 
DW_UT_lo_user 
DW_UT_hi_user 

Definition at line 369 of file dwarf.c.

Function Documentation

◆ abbrev_compare()

static int abbrev_compare ( const void *  v1,
const void *  v2 
)
static

Definition at line 1849 of file dwarf.c.

+ Here is the caller graph for this function:

◆ add_function_range()

static int add_function_range ( struct backtrace_state state,
void *  rdata,
uintptr_t  lowpc,
uintptr_t  highpc,
backtrace_error_callback  error_callback,
void *  data,
void *  pvec 
)
static

Definition at line 3714 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ add_line()

static int add_line ( struct backtrace_state state,
struct dwarf_data ddata,
uintptr_t  pc,
const char *  filename,
int  lineno,
backtrace_error_callback  error_callback,
void *  data,
struct line_vector vec 
)
static

Definition at line 2820 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ add_low_high_range()

static int add_low_high_range ( struct backtrace_state state,
const struct dwarf_sections dwarf_sections,
struct libbacktrace_base_address  base_address,
int  is_bigendian,
struct unit u,
const struct pcrange pcrange,
int(*)(struct backtrace_state *state, void *rdata, uintptr_t lowpc, uintptr_t highpc, backtrace_error_callback error_callback, void *data, void *vec)  add_range,
void *  rdata,
backtrace_error_callback  error_callback,
void *  data,
void *  vec 
)
static

Definition at line 2133 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ add_ranges()

static int add_ranges ( struct backtrace_state state,
const struct dwarf_sections dwarf_sections,
struct libbacktrace_base_address  base_address,
int  is_bigendian,
struct unit u,
uintptr_t  base,
const struct pcrange pcrange,
int(*)(struct backtrace_state *state, void *rdata, uintptr_t lowpc, uintptr_t highpc, backtrace_error_callback error_callback, void *data, void *vec)  add_range,
void *  rdata,
backtrace_error_callback  error_callback,
void *  data,
void *  vec 
)
static

Definition at line 2430 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ add_ranges_from_ranges()

static int add_ranges_from_ranges ( struct backtrace_state state,
const struct dwarf_sections dwarf_sections,
struct libbacktrace_base_address  base_address,
int  is_bigendian,
struct unit u,
uintptr_t  base,
const struct pcrange pcrange,
int(*)(struct backtrace_state *state, void *rdata, uintptr_t lowpc, uintptr_t highpc, backtrace_error_callback error_callback, void *data, void *vec)  add_range,
void *  rdata,
backtrace_error_callback  error_callback,
void *  data,
void *  vec 
)
static

Definition at line 2182 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ add_ranges_from_rnglists()

static int add_ranges_from_rnglists ( struct backtrace_state state,
const struct dwarf_sections dwarf_sections,
struct libbacktrace_base_address  base_address,
int  is_bigendian,
struct unit u,
uintptr_t  base,
const struct pcrange pcrange,
int(*)(struct backtrace_state *state, void *rdata, uintptr_t lowpc, uintptr_t highpc, backtrace_error_callback error_callback, void *data, void *vec)  add_range,
void *  rdata,
backtrace_error_callback  error_callback,
void *  data,
void *  vec 
)
static

Definition at line 2250 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ add_unit_addr()

static int add_unit_addr ( struct backtrace_state state,
void *  rdata,
uintptr_t  lowpc,
uintptr_t  highpc,
backtrace_error_callback  error_callback,
void *  data,
void *  pvec 
)
static

Definition at line 1530 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ advance()

static int advance ( struct dwarf_buf buf,
size_t  count 
)
static

Definition at line 778 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ backtrace_dwarf_add()

int backtrace_dwarf_add ( struct backtrace_state state,
struct libbacktrace_base_address  base_address,
const struct dwarf_sections dwarf_sections,
int  is_bigendian,
struct dwarf_data fileline_altlink,
backtrace_error_callback  error_callback,
void *  data,
fileline fileline_fn,
struct dwarf_data **  fileline_entry 
)

Definition at line 4536 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ build_address_map()

static int build_address_map ( struct backtrace_state state,
struct libbacktrace_base_address  base_address,
const struct dwarf_sections dwarf_sections,
int  is_bigendian,
struct dwarf_data altlink,
backtrace_error_callback  error_callback,
void *  data,
struct unit_addrs_vector addrs,
struct unit_vector unit_vec 
)
static

Definition at line 2624 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ build_dwarf_data()

static struct dwarf_data * build_dwarf_data ( struct backtrace_state state,
struct libbacktrace_base_address  base_address,
const struct dwarf_sections dwarf_sections,
int  is_bigendian,
struct dwarf_data altlink,
backtrace_error_callback  error_callback,
void *  data 
)
static

Definition at line 4482 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dwarf_buf_error()

static void dwarf_buf_error ( struct dwarf_buf buf,
const char *  msg,
int  errnum 
)
static

Definition at line 747 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dwarf_fileline()

static int dwarf_fileline ( struct backtrace_state state,
uintptr_t  pc,
backtrace_full_callback  callback,
backtrace_error_callback  error_callback,
void *  data 
)
static

Definition at line 4433 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dwarf_lookup_pc()

static int dwarf_lookup_pc ( struct backtrace_state state,
struct dwarf_data ddata,
uintptr_t  pc,
backtrace_full_callback  callback,
backtrace_error_callback  error_callback,
void *  data,
int *  found 
)
static

Definition at line 4171 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ find_address_ranges()

static int find_address_ranges ( struct backtrace_state state,
struct libbacktrace_base_address  base_address,
struct dwarf_buf unit_buf,
const struct dwarf_sections dwarf_sections,
int  is_bigendian,
struct dwarf_data altlink,
backtrace_error_callback  error_callback,
void *  data,
struct unit u,
struct unit_addrs_vector addrs,
enum dwarf_tag unit_tag 
)
static

Definition at line 2468 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ find_unit()

static struct unit * find_unit ( struct unit **  pu,
size_t  units_count,
size_t  offset 
)
static

Definition at line 1477 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ free_abbrevs()

static void free_abbrevs ( struct backtrace_state state,
struct abbrevs abbrevs,
backtrace_error_callback  error_callback,
void *  data 
)
static

Definition at line 1066 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ free_line_header()

static void free_line_header ( struct backtrace_state state,
struct line_header hdr,
backtrace_error_callback  error_callback,
void *  data 
)
static

Definition at line 2858 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ function_addrs_compare()

static int function_addrs_compare ( const void *  v1,
const void *  v2 
)
static

Definition at line 1488 of file dwarf.c.

+ Here is the caller graph for this function:

◆ function_addrs_search()

static int function_addrs_search ( const void *  vkey,
const void *  ventry 
)
static

Definition at line 1511 of file dwarf.c.

+ Here is the caller graph for this function:

◆ is_highest_address()

static int is_highest_address ( uint64_t  address,
int  addrsize 
)
static

Definition at line 938 of file dwarf.c.

+ Here is the caller graph for this function:

◆ leb128_len()

static size_t leb128_len ( const unsigned char *  p)
static

Definition at line 1031 of file dwarf.c.

+ Here is the caller graph for this function:

◆ line_compare()

static int line_compare ( const void *  v1,
const void *  v2 
)
static

Definition at line 1807 of file dwarf.c.

+ Here is the caller graph for this function:

◆ line_search()

static int line_search ( const void *  vkey,
const void *  ventry 
)
static

Definition at line 1830 of file dwarf.c.

+ Here is the caller graph for this function:

◆ lookup_abbrev()

static const struct abbrev * lookup_abbrev ( struct abbrevs abbrevs,
uint64_t  code,
backtrace_error_callback  error_callback,
void *  data 
)
static

Definition at line 2023 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read_abbrevs()

static int read_abbrevs ( struct backtrace_state state,
uint64_t  abbrev_offset,
const unsigned char *  dwarf_abbrev,
size_t  dwarf_abbrev_size,
int  is_bigendian,
backtrace_error_callback  error_callback,
void *  data,
struct abbrevs abbrevs 
)
static

Definition at line 1871 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read_address()

static uint64_t read_address ( struct dwarf_buf buf,
int  addrsize 
)
static

Definition at line 916 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read_attribute()

static int read_attribute ( enum dwarf_form  form,
uint64_t  implicit_val,
struct dwarf_buf buf,
int  is_dwarf64,
int  version,
int  addrsize,
const struct dwarf_sections dwarf_sections,
struct dwarf_data altlink,
struct attr_val val 
)
static

Definition at line 1088 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read_byte()

static unsigned char read_byte ( struct dwarf_buf buf)
static

Definition at line 809 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read_function_entry()

static int read_function_entry ( struct backtrace_state state,
struct dwarf_data ddata,
struct unit u,
uintptr_t  base,
struct dwarf_buf unit_buf,
const struct line_header lhdr,
backtrace_error_callback  error_callback,
void *  data,
struct function_vector vec_function,
struct function_vector vec_inlined 
)
static

Definition at line 3754 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read_function_info()

static void read_function_info ( struct backtrace_state state,
struct dwarf_data ddata,
const struct line_header lhdr,
backtrace_error_callback  error_callback,
void *  data,
struct unit u,
struct function_vector fvec,
struct function_addrs **  ret_addrs,
size_t ret_addrs_count 
)
static

Definition at line 4007 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read_initial_length()

static uint64_t read_initial_length ( struct dwarf_buf buf,
int *  is_dwarf64 
)
static

Definition at line 1047 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read_line_header()

static int read_line_header ( struct backtrace_state state,
struct dwarf_data ddata,
struct unit u,
int  is_dwarf64,
struct dwarf_buf line_buf,
struct line_header hdr 
)
static

Definition at line 3175 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read_line_header_format_entries()

static int read_line_header_format_entries ( struct backtrace_state state,
struct dwarf_data ddata,
struct unit u,
struct dwarf_buf hdr_buf,
struct line_header hdr,
size_t pcount,
const char ***  ppaths 
)
static

Definition at line 3092 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read_line_info()

static int read_line_info ( struct backtrace_state state,
struct dwarf_data ddata,
backtrace_error_callback  error_callback,
void *  data,
struct unit u,
struct line_header hdr,
struct line **  lines,
size_t lines_count 
)
static

Definition at line 3459 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read_line_program()

static int read_line_program ( struct backtrace_state state,
struct dwarf_data ddata,
const struct line_header hdr,
struct dwarf_buf line_buf,
struct line_vector vec 
)
static

Definition at line 3257 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read_lnct()

static int read_lnct ( struct backtrace_state state,
struct dwarf_data ddata,
struct unit u,
struct dwarf_buf hdr_buf,
const struct line_header hdr,
size_t  formats_count,
const struct line_header_format formats,
const char **  string 
)
static

Definition at line 3006 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read_offset()

static uint64_t read_offset ( struct dwarf_buf buf,
int  is_dwarf64 
)
static

Definition at line 904 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read_referenced_name()

static const char * read_referenced_name ( struct dwarf_data ddata,
struct unit u,
uint64_t  offset,
backtrace_error_callback  error_callback,
void *  data 
)
static

Definition at line 3602 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read_referenced_name_from_attr()

static const char * read_referenced_name_from_attr ( struct dwarf_data ddata,
struct unit u,
struct attr attr,
struct attr_val val,
backtrace_error_callback  error_callback,
void *  data 
)
static

Definition at line 3548 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read_sbyte()

static signed char read_sbyte ( struct dwarf_buf buf)
static

Definition at line 821 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read_sleb128()

static int64_t read_sleb128 ( struct dwarf_buf buf)
static

Definition at line 993 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read_string()

static const char * read_string ( struct dwarf_buf buf)
static

Definition at line 790 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read_uint16()

static uint16_t read_uint16 ( struct dwarf_buf buf)
static

Definition at line 833 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read_uint24()

static uint32_t read_uint24 ( struct dwarf_buf buf)
static

Definition at line 848 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read_uint32()

static uint32_t read_uint32 ( struct dwarf_buf buf)
static

Definition at line 865 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read_uint64()

static uint64_t read_uint64 ( struct dwarf_buf buf)
static

Definition at line 882 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read_uleb128()

static uint64_t read_uleb128 ( struct dwarf_buf buf)
static

Definition at line 958 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read_v2_paths()

static int read_v2_paths ( struct backtrace_state state,
struct unit u,
struct dwarf_buf hdr_buf,
struct line_header hdr 
)
static

Definition at line 2873 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ report_inlined_functions()

static int report_inlined_functions ( uintptr_t  pc,
struct function function,
backtrace_full_callback  callback,
void *  data,
const char **  filename,
int *  lineno 
)
static

Definition at line 4093 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ require()

static int require ( struct dwarf_buf buf,
size_t  count 
)
static

Definition at line 760 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resolve_addr_index()

static int resolve_addr_index ( const struct dwarf_sections dwarf_sections,
uint64_t  addr_base,
int  addrsize,
int  is_bigendian,
uint64_t  addr_index,
backtrace_error_callback  error_callback,
void *  data,
uintptr_t *  address 
)
static

Definition at line 1427 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resolve_string()

static int resolve_string ( const struct dwarf_sections dwarf_sections,
int  is_dwarf64,
int  is_bigendian,
uint64_t  str_offsets_base,
const struct attr_val val,
backtrace_error_callback  error_callback,
void *  data,
const char **  string 
)
static

Definition at line 1372 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resolve_unit_addrs_overlap()

static int resolve_unit_addrs_overlap ( struct backtrace_state state,
backtrace_error_callback  error_callback,
void *  data,
struct unit_addrs_vector addrs_vec 
)
static

Definition at line 1748 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resolve_unit_addrs_overlap_walk()

static int resolve_unit_addrs_overlap_walk ( struct backtrace_state state,
size_t pfrom,
size_t pto,
struct unit_addrs enclosing,
struct unit_addrs_vector old_vec,
backtrace_error_callback  error_callback,
void *  data,
struct unit_addrs_vector new_vec 
)
static

Definition at line 1617 of file dwarf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unit_addrs_compare()

static int unit_addrs_compare ( const void *  v1,
const void *  v2 
)
static

Definition at line 1571 of file dwarf.c.

+ Here is the caller graph for this function:

◆ unit_addrs_search()

static int unit_addrs_search ( const void *  vkey,
const void *  ventry 
)
static

Definition at line 1598 of file dwarf.c.

+ Here is the caller graph for this function:

◆ units_search()

static int units_search ( const void *  vkey,
const void *  ventry 
)
static

Definition at line 1459 of file dwarf.c.

+ Here is the caller graph for this function:

◆ update_pcrange()

static void update_pcrange ( const struct attr attr,
const struct attr_val val,
struct pcrange pcrange 
)
static

Definition at line 2070 of file dwarf.c.

+ Here is the caller graph for this function:

◆ xstrnlen()

static size_t xstrnlen ( const char *  s,
size_t  maxlen 
)
static

Definition at line 385 of file dwarf.c.