***************** experimental DWARF reading ***********
debug
Sourceval my_debug : 'a -> unit
Sourceval my_debug2 : 'a -> unit
Sourceval my_debug3 : 'a -> unit
Sourceval my_debug4 : string -> unit
Sourceval my_debug5 : string -> unit
************************************************************
** dwarf representation types ****************************
************************************************************
Sourcetype dwarf_attribute_classes =
| DWA_7_5_3
| DWA_address
| DWA_block
| DWA_constant
| DWA_dash
| DWA_exprloc
| DWA_flag
| DWA_lineptr
| DWA_loclistptr
| DWA_macptr
| DWA_rangelistptr
| DWA_reference
| DWA_string
Sourcetype operation_argument_type =
| OAT_addr
| OAT_dwarf_format_t
| OAT_uint8
| OAT_uint16
| OAT_uint32
| OAT_uint64
| OAT_sint8
| OAT_sint16
| OAT_sint32
| OAT_sint64
| OAT_ULEB128
| OAT_SLEB128
| OAT_block
Sourcetype operation_stack = Nat_big_num.num list
Sourcetype arithmetic_context = {
ac_bitwidth : Nat_big_num.num;
ac_half : Nat_big_num.num;
ac_all : Nat_big_num.num;
ac_max : Nat_big_num.num;
}
Sourcetype operation_semantics =
| OpSem_lit
| OpSem_deref
| OpSem_stack of arithmetic_context ->
operation_stack ->
operation_argument_value list ->
operation_stack option
| OpSem_not_supported
| OpSem_binary of arithmetic_context ->
Nat_big_num.num ->
Nat_big_num.num ->
Nat_big_num.num option
| OpSem_unary of arithmetic_context -> Nat_big_num.num -> Nat_big_num.num option
| OpSem_opcode_lit of Nat_big_num.num
| OpSem_reg
| OpSem_breg
| OpSem_bregx
| OpSem_fbreg
| OpSem_deref_size
| OpSem_nop
| OpSem_piece
| OpSem_bit_piece
| OpSem_implicit_value
| OpSem_stack_value
| OpSem_call_frame_cfa
Sourcetype 'a register_read_result =
| RRR_result of Nat_big_num.num
| RRR_not_currently_available
| RRR_bad_register_number
Sourcetype 'a memory_read_result =
| MRR_result of Nat_big_num.num
| MRR_not_currently_available
| MRR_bad_address
Sourcetype abbreviation_declaration = {
ad_abbreviation_code : Nat_big_num.num;
ad_tag : Nat_big_num.num;
ad_has_children : bool;
ad_attribute_specifications : (Nat_big_num.num * Nat_big_num.num) list;
}
Sourcetype die_index = (Nat_big_num.num, die list * die) Pmap.map
Sourcetype location_list_entry = {
lle_beginning_address_offset : Nat_big_num.num;
lle_ending_address_offset : Nat_big_num.num;
lle_single_location_description : single_location_description;
}
Sourcetype base_address_selection_entry = {
base_address : Nat_big_num.num;
}
Sourcetype range_list_entry = {
rle_beginning_address_offset : Nat_big_num.num;
rle_ending_address_offset : Nat_big_num.num;
}
Sourcetype cfa_address = Nat_big_num.num
Sourcetype cfa_delta = Nat_big_num.num
Sourcetype cfa_offset = Nat_big_num.num
Sourcetype cfa_register = Nat_big_num.num
Sourcetype cfa_sfoffset = Nat_big_num.num
Sourcetype call_frame_argument_type =
| CFAT_address
| CFAT_delta1
| CFAT_delta2
| CFAT_delta4
| CFAT_delta_ULEB128
| CFAT_offset
| CFAT_sfoffset
| CFAT_register
| CFAT_block
Sourcetype cie = {
cie_offset : Nat_big_num.num;
cie_length : Nat_big_num.num;
cie_id : Nat_big_num.num;
cie_version : Nat_big_num.num;
cie_augmentation : Byte_sequence.byte_sequence0;
cie_address_size : Nat_big_num.num option;
cie_segment_size : Nat_big_num.num option;
cie_code_alignment_factor : Nat_big_num.num;
cie_data_alignment_factor : Nat_big_num.num;
cie_return_address_register : cfa_register;
cie_initial_instructions_bytes : Byte_sequence.byte_sequence0;
cie_initial_instructions : call_frame_instruction list;
}
Sourcetype fde = {
fde_offset : Nat_big_num.num;
fde_length : Nat_big_num.num;
fde_cie_pointer : Nat_big_num.num;
fde_initial_location_segment_selector : Nat_big_num.num option;
fde_initial_location_address : Nat_big_num.num;
fde_address_range : Nat_big_num.num;
fde_instructions_bytes : Byte_sequence.byte_sequence0;
fde_instructions : call_frame_instruction list;
}
Sourcetype frame_info_element =
| FIE_cie of cie
| FIE_fde of fde
Sourcetype line_number_argument_type =
| LNAT_address
| LNAT_ULEB128
| LNAT_SLEB128
| LNAT_uint16
| LNAT_string
Sourcetype line_number_argument_value =
| LNAV_address of Nat_big_num.num
| LNAV_ULEB128 of Nat_big_num.num
| LNAV_SLEB128 of Nat_big_num.num
| LNAV_uint16 of Nat_big_num.num
| LNAV_string of Byte_sequence.byte_sequence0
Sourcetype line_number_operation =
| DW_LNS_copy
| DW_LNS_advance_pc of Nat_big_num.num
| DW_LNS_advance_line of Nat_big_num.num
| DW_LNS_set_file of Nat_big_num.num
| DW_LNS_set_column of Nat_big_num.num
| DW_LNS_negate_stmt
| DW_LNS_set_basic_block
| DW_LNS_const_add_pc
| DW_LNS_fixed_advance_pc of Nat_big_num.num
| DW_LNS_set_prologue_end
| DW_LNS_set_epilogue_begin
| DW_LNS_set_isa of Nat_big_num.num
| DW_LNE_end_sequence
| DW_LNE_set_address of Nat_big_num.num
| DW_LNE_define_file of Byte_sequence.byte_sequence0
* Nat_big_num.num
* Nat_big_num.num
* Nat_big_num.num
| DW_LNE_set_discriminator of Nat_big_num.num
| DW_LN_special of Nat_big_num.num
Sourcetype line_number_file_entry = {
lnfe_path : Byte_sequence.byte_sequence0;
lnfe_directory_index : Nat_big_num.num;
lnfe_last_modification : Nat_big_num.num;
lnfe_length : Nat_big_num.num;
}
Sourcetype line_number_registers = {
lnr_address : Nat_big_num.num;
lnr_op_index : Nat_big_num.num;
lnr_file : Nat_big_num.num;
lnr_line : Nat_big_num.num;
lnr_column : Nat_big_num.num;
lnr_is_stmt : bool;
lnr_basic_block : bool;
lnr_end_sequence : bool;
lnr_prologue_end : bool;
lnr_epilogue_begin : bool;
lnr_isa : Nat_big_num.num;
lnr_discriminator : Nat_big_num.num;
}
Sourcetype unpacked_file_entry = string option * string option * string
context for parsing and pp functions
Sourcetype decl = {
decl_file : string option;
decl_line : Nat_big_num.num option;
}
Sourcetype 't array_dimension = Nat_big_num.num option * 't option
Sourcetype 't struct_union_member =
cupdie * string option * 't * Nat_big_num.num option
Sourcetype struct_union_type_kind =
| Atk_structure
| Atk_union
Sourcetype enumeration_member = cupdie * string option * Nat_big_num.num
Sourcetype sdt_unspecified_parameter = unit
Sourcetype sdt_subroutine_kind =
| SSK_subprogram
| SSK_inlined_subroutine
Sourcetype inlined_subroutine_data_by_range_entry =
(Nat_big_num.num * Nat_big_num.num)
* (Nat_big_num.num * Nat_big_num.num)
* inlined_subroutine
************************************************************
** missing pervasives ************************************
************************************************************
Sourceval index_natural : 'a list -> Nat_big_num.num -> 'a option
Sourceval partialNaturalFromInteger : Nat_big_num.num -> Nat_big_num.num
************************************************************
** endianness ***************************************
************************************************************
************************************************************
** dwarf encodings ***************************************
************************************************************
Sourceval tag_encodings : (string * Nat_big_num.num) list
Sourceval vDW_CHILDREN_no : Nat_big_num.num
Sourceval vDW_CHILDREN_yes : Nat_big_num.num
Sourceval vDW_OP_reg0 : Nat_big_num.num
Sourceval vDW_OP_breg0 : Nat_big_num.num
Sourceval base_type_attribute_encodings : (string * Nat_big_num.num) list
************************************************************
** more missing pervasives and bits ***********************
************************************************************
Sourceval myconcat : string -> string list -> string
Sourceval myhead : 'a list -> 'a
Sourceval myfindNonPure : ('a -> bool) -> 'a list -> 'a
Sourceval myfindmaybe : ('a -> 'b option) -> 'a list -> 'b option
Sourceval myfind : ('a -> bool) -> 'a list -> 'a option
Sourceval myfiltermaybe : ('a -> 'b option) -> 'a list -> 'b list
Sourceval bigunionListMap :
'b Lem_basic_classes.setType_class ->
('a -> 'b Pset.set) ->
'a list ->
'b Pset.set
Sourceval mytake' :
Nat_big_num.num ->
'a list ->
'a list ->
('a list * 'a list) option
Sourceval mytake : Nat_big_num.num -> 'a list -> ('a list * 'a list) option
Sourceval mynth : Nat_big_num.num -> 'a list -> 'a option
basic pretty printing
Sourceval pphexplain : Nat_big_num.num -> string
Sourceval pphex : Nat_big_num.num -> string
Sourceval pphex_integer : Nat_big_num.num -> string
Sourceval string_of_bytes : char list -> string
Sourceval just_one : string -> 'a list -> 'a
Sourceval max_address : Nat_big_num.num -> Nat_big_num.num
lookup of encodings
Sourceval lookup_Ab_b :
'a Lem_basic_classes.eq_class ->
'a ->
('a * 'b) list ->
'b option
Sourceval lookup_aB_a :
'b Lem_basic_classes.eq_class ->
'b ->
('a * 'b) list ->
'a option
Sourceval lookup_aBc_a :
'b Lem_basic_classes.eq_class ->
'b ->
('a * 'b * 'c) list ->
'a option
Sourceval lookup_aBc_ac :
'b Lem_basic_classes.eq_class ->
'b ->
('a * 'b * 'c) list ->
('a * 'c) option
Sourceval lookup_Abc_b :
'a Lem_basic_classes.eq_class ->
'a ->
('a * 'b * 'c) list ->
'b option
Sourceval lookup_aBcd_a :
'b Lem_basic_classes.eq_class ->
'b ->
('a * 'b * 'c * 'd) list ->
'a option
Sourceval lookup_aBcd_acd :
'b Lem_basic_classes.eq_class ->
'b ->
('a * 'b * 'c * 'd) list ->
('a * 'c * 'd) option
Sourceval lookup_abCde_de :
'a Lem_basic_classes.eq_class ->
'a ->
('b * 'c * 'a * 'd * 'e) list ->
('d * 'e) option
Sourceval pp_maybe : (Nat_big_num.num -> string option) -> Nat_big_num.num -> string
Sourceval pp_tag_encoding : Nat_big_num.num -> string
Sourceval pp_attribute_encoding : Nat_big_num.num -> string
Sourceval pp_operation_encoding : Nat_big_num.num -> string
Sourceval tag_encode : string -> Nat_big_num.num
Sourceval attribute_encode : string -> Nat_big_num.num
Sourceval base_type_attribute_encode : string -> Nat_big_num.num
************************************************************
** parser combinators and primitives *********************
************************************************************
Sourceval parse_uint8_constant : Nat_big_num.num -> Nat_big_num.num parser
Sourceval integerFromTwosComplementNatural :
Nat_big_num.num ->
Nat_big_num.num ->
Nat_big_num.num ->
Nat_big_num.num
Sourceval partialTwosComplementNaturalFromInteger :
Nat_big_num.num ->
Nat_big_num.num ->
Nat_big_num.num ->
Nat_big_num.num
Sourceval parse_ULEB128' :
Nat_big_num.num ->
Nat_big_num.num ->
Nat_big_num.num parser
Sourceval parse_SLEB128' :
Nat_big_num.num ->
Nat_big_num.num ->
(bool * Nat_big_num.num * Nat_big_num.num) parser
Sourceval parse_nonzero_ULEB128_pair :
(Nat_big_num.num * Nat_big_num.num) option parser
Sourceval parse_zero_terminated_ULEB128_pair_list :
(Nat_big_num.num * Nat_big_num.num) list parser
Sourceval parse_uint_segment_selector_size :
p_context ->
Nat_big_num.num ->
Nat_big_num.num option parser
************************************************************
** parsing and pretty printing of .debug_* sections ******
************************************************************
abbreviations table: pp and parsing
Sourceval remove_duplicates :
'a Lem_basic_classes.eq_class ->
('a * 'b) list ->
('a * 'b) list ->
('a * 'b) list
debug_str entry
operations: pp and parsing
attribute values: pp and parsing
Sourceval pp_pos : Nat_big_num.num -> string
************************************************************
** finding things in the die tree
************************************************************
Sourceval find_maybe : ('a -> 'b option) -> 'a list -> 'b option
convert attribute values to usable Lem types
attribute find
Sourceval find_natural_attribute_value_of_die :
p_context ->
string ->
die ->
Nat_big_num.num option
Sourceval find_integer_attribute_value_of_die :
p_context ->
string ->
die ->
Nat_big_num.num option
Sourceval find_flag_attribute_value_of_die : string -> die -> bool option
Sourceval find_flag_attribute_value_of_die_default_false : string -> die -> bool
Sourceval find_flag_attribute_value_of_die_using_abstract_origin :
dwarf ->
string ->
cupdie ->
bool option
compilation unit header: pp and parsing
type unit header: pp and parsing
debugging information entries: pp and parsing
debugging information entries: pp and parsing
Sourceval indent_level : bool -> Nat_big_num.num -> string
Sourceval indent_level_plus_one : bool -> Nat_big_num.num -> string
Sourceval has_attribute : string -> die -> bool
compilation units: pp and parsing
type units: pp and parsing
location lists, pp and parsing
range lists, pp and parsing
Sourceval interpret_range_list :
Nat_big_num.num ->
range_list_item list ->
(Nat_big_num.num * Nat_big_num.num) list
frame information, pp and parsing
Sourceval pp_cfa_address : Nat_big_num.num -> string
Sourceval pp_cfa_delta : Nat_big_num.num -> string
Sourceval pp_cfa_offset : Nat_big_num.num -> string
line numbers .debug_line, pp and parsing
all dwarf info: pp and parsing
************************************************************
****** location evaluation ********************************
************************************************************
pp of locations
evaluation of location expressions
************************************************************
**** evaluation of frame information **********************
************************************************************
register maps
pp of evaluated cfa information from .debug_frame
Sourceval max_lengths : string list list -> Nat_big_num.num list
Sourceval pad_row : string list -> Nat_big_num.num list -> string list
Sourceval pad_rows : string list list -> string
Sourceval semi_pp_evaluated_fde :
('a * cfa_table_row list) ->
(Nat_big_num.num * string * (string * string) list) list
Sourceval semi_pp_evaluated_frame_info :
('a * cfa_table_row list) list ->
(Nat_big_num.num * string * (string * string) list) list
evaluation of cfa information from .debug_frame
************************************************************
** pp of type info
************************************************************
Sourceval strict : (unit -> string) -> 'a option -> 'a
Sourceval pp_all_struct_union_enum_types' : dwarf -> string
************************************************************
** analysis of location and frame data for reverse mapping
************************************************************
analysis
simple-minded analysis of location
more proper analysis of locations
Sourceval entry_address : die -> Nat_big_num.num option
**********************************************************************
** estimate source-file line extents of each (non-inlined) subprogram
**********************************************************************
Sourceval partitionby :
'a Lem_basic_classes.eq_class ->
'b Lem_basic_classes.eq_class ->
('a -> 'b) ->
('a -> 'a -> bool) ->
'a list ->
('b * 'a list) list ->
('b * 'a list) list
Sourceval find_by_line :
'b Lem_basic_classes.ord_class ->
'b ->
('a * 'c * 'b) list ->
'b ->
'a ->
'a
Sourceval subprogram_at_line :
((string option * string option * string)
* (string * 'a * Nat_big_num.num) list)
list ->
unpacked_file_entry ->
Nat_big_num.num ->
string
************************************************************
** pull out subprograms
************************************************************
************************************************************
** evaluation of line-number info
************************************************************
************************************************************
** collecting all the statically calculated analysis info
************************************************************
************************************************************
** collect simple die tree view
************************************************************
Sourceval strict_mss : 'a option -> string -> ('b -> string) -> 'b -> 'a
Sourceval strict_mscu : 'a option -> string -> ('b -> string) -> 'b -> 'a
Sourceval mk_sdt_dwarf :
dwarf ->
((string option * string option * string)
* (string * 'a * Nat_big_num.num) list)
list ->
sdt_dwarf
Sourceval pp_parsed_single_location_description :
Nat_big_num.num ->
(Nat_big_num.num * Nat_big_num.num * operation list) ->
string
Sourceval pp_pc_ranges :
Nat_big_num.num ->
(Nat_big_num.num * Nat_big_num.num) list option ->
string
Sourceval pp_sdt_maybe : 'a option -> ('a -> string) -> string
Sourceval pp_sdt_maybe' : ('a -> string) -> 'a option -> string
Sourceval pp_sdt_list : 'a list -> ('a -> string) -> string
************************************************************
** analysis of inlined_subroutine data
************************************************************
Sourceval is_lt :
'a Lem_basic_classes.eq_class ->
'b Lem_basic_classes.ord_class ->
'a Lem_basic_classes.ord_class ->
(('a * 'b) * ('c * 'd) * 'e) ->
(('a * 'b) * ('f * 'g) * 'h) ->
bool
Sourceval pp_inlined_subroutine_parents : die list -> string
************************************************************
** pp of text section
************************************************************
Sourceval words_of_byte_sequence :
Nat_big_num.num ->
Byte_sequence.byte_sequence0 ->
(Nat_big_num.num * Nat_big_num.num) list ->
(Nat_big_num.num * Nat_big_num.num) list
Sourceval pp_instruction : (Nat_big_num.num * Nat_big_num.num) -> string
************************************************************
** top level for main_elf ********************************
************************************************************