aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2015-07-02 12:59:10 +0200
committerBernhard Schommer <bernhardschommer@gmail.com>2015-07-02 12:59:10 +0200
commitc32e15e23759d354c1491a69767093e374f52754 (patch)
treed661c371fab8b4c684bfd4b34a2b53f6e54a6686
parentb946cdfc8e33468a813cd8b2e41aa3442b51f04f (diff)
downloadcompcert-kvx-c32e15e23759d354c1491a69767093e374f52754.tar.gz
compcert-kvx-c32e15e23759d354c1491a69767093e374f52754.zip
Do not search for high and low pc of inlined functions.
-rw-r--r--backend/PrintAsm.ml2
-rw-r--r--debug/DwarfPrinter.ml14
-rw-r--r--debug/DwarfTypes.mli2
3 files changed, 13 insertions, 5 deletions
diff --git a/backend/PrintAsm.ml b/backend/PrintAsm.ml
index e91b4e03..f3c80f3e 100644
--- a/backend/PrintAsm.ml
+++ b/backend/PrintAsm.ml
@@ -119,7 +119,7 @@ module Printer(Target:TARGET) =
let get_end_addr = Target.get_end_addr
let get_stmt_list_addr = Target.get_stmt_list_addr
let name_of_section = Target.name_of_section
- let get_fun_addr s = Hashtbl.find addr_mapping s
+ let get_fun_addr s = try Some (Hashtbl.find addr_mapping s) with Not_found -> None
end
module DebugPrinter = DwarfPrinter (DwarfTarget) (Target.DwarfAbbrevs)
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