From c32e15e23759d354c1491a69767093e374f52754 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Thu, 2 Jul 2015 12:59:10 +0200 Subject: Do not search for high and low pc of inlined functions. --- debug/DwarfPrinter.ml | 14 +++++++++++--- debug/DwarfTypes.mli | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'debug') diff --git a/debug/DwarfPrinter.ml b/debug/DwarfPrinter.ml index 53caa8f1..cf3c7730 100644 --- a/debug/DwarfPrinter.ml +++ b/debug/DwarfPrinter.ml @@ -62,6 +62,11 @@ module DwarfPrinter(Target: DWARF_TARGET)(DwarfAbbrevs:DWARF_ABBREVS): let add_low_pc = add_abbr_entry (0x11,low_pc_type_abbr) + let add_fun_pc sp buf = + match get_fun_addr sp.subprogram_name with + | None ->() + | Some (a,b) -> add_high_pc buf; add_low_pc buf + let add_declaration = add_abbr_entry (0x3c,declaration_type_abbr) let add_location loc buf = @@ -387,13 +392,16 @@ module DwarfPrinter(Target: DWARF_TARGET)(DwarfAbbrevs:DWARF_ABBREVS): print_opt_value oc st.structure_declaration print_flag; print_opt_value oc st.structure_name print_string + let print_subprogram_addr oc (s,e) = + fprintf oc " .4byte %a\n" label s; + fprintf oc " .4byte %a\n" label e + let print_subprogram oc sp = - let s,e = get_fun_addr sp.subprogram_name in + let addr = get_fun_addr sp.subprogram_name in print_file_loc oc sp.subprogram_file_loc; print_opt_value oc sp.subprogram_external print_flag; print_opt_value oc sp.subprogram_frame_base print_loc; - fprintf oc " .4byte %a\n" label s; - fprintf oc " .4byte %a\n" label e; + print_opt_value oc addr print_subprogram_addr; print_string oc sp.subprogram_name; print_flag oc sp.subprogram_prototyped; print_opt_value oc sp.subprogram_type print_ref diff --git a/debug/DwarfTypes.mli b/debug/DwarfTypes.mli index e32f6fab..e3d08e57 100644 --- a/debug/DwarfTypes.mli +++ b/debug/DwarfTypes.mli @@ -268,5 +268,5 @@ module type DWARF_TARGET= val get_end_addr: unit -> int val get_stmt_list_addr: unit -> int val name_of_section: section_name -> string - val get_fun_addr: string -> int * int + val get_fun_addr: string -> (int * int) option end -- cgit