From 13b1d1fbe9408659c278696fb6a0eb2f213ea78f Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Fri, 2 Oct 2015 09:52:06 +0200 Subject: Always call print debug_section in the prologue. Since files without function definition contain no function in the Section_text the filenum would be empty otherwise. --- debug/DebugInformation.ml | 2 +- powerpc/TargetPrinter.ml | 36 ++++++++++++++++++------------------ 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/debug/DebugInformation.ml b/debug/DebugInformation.ml index 40cc4060..9100e60b 100644 --- a/debug/DebugInformation.ml +++ b/debug/DebugInformation.ml @@ -686,5 +686,5 @@ let init name = Hashtbl.reset compilation_section_start; Hashtbl.reset compilation_section_end; Hashtbl.reset filenum; - all_files := StringSet.empty; + all_files := StringSet.singleton name; printed_vars := StringSet.empty; diff --git a/powerpc/TargetPrinter.ml b/powerpc/TargetPrinter.ml index e77582b2..05ff3366 100644 --- a/powerpc/TargetPrinter.ml +++ b/powerpc/TargetPrinter.ml @@ -225,23 +225,6 @@ module Diab_System : SYSTEM = let cfi_adjust oc delta = () let cfi_rel_offset oc reg ofs = () - - let print_prologue oc = - fprintf oc " .xopt align-fill-text=0x60000000\n" - - let print_epilogue oc = - let end_label sec = - fprintf oc "\n"; - fprintf oc " %s\n" sec; - let label_end = new_label () in - fprintf oc "%a:\n" label label_end; - label_end - and entry_label f = - let label = new_label () in - fprintf oc ".L%d: .d2filenum \"%s\"\n" label f; - label - and end_line () = fprintf oc " .d2_line_end\n" in - Debug.compute_file_enum end_label entry_label end_line let debug_section oc sec = match sec with @@ -268,7 +251,24 @@ module Diab_System : SYSTEM = fprintf oc " .d2_line_start %s\n" line_name else () - + + let print_prologue oc = + fprintf oc " .xopt align-fill-text=0x60000000\n"; + debug_section oc Section_text + + let print_epilogue oc = + let end_label sec = + fprintf oc "\n"; + fprintf oc " %s\n" sec; + let label_end = new_label () in + fprintf oc "%a:\n" label label_end; + label_end + and entry_label f = + let label = new_label () in + fprintf oc ".L%d: .d2filenum \"%s\"\n" label f; + label + and end_line () = fprintf oc " .d2_line_end\n" in + Debug.compute_file_enum end_label entry_label end_line end -- cgit