aboutsummaryrefslogtreecommitdiffstats
path: root/backend
diff options
context:
space:
mode:
Diffstat (limited to 'backend')
-rw-r--r--backend/PrintAsm.ml19
-rw-r--r--backend/PrintAsmaux.ml9
2 files changed, 13 insertions, 15 deletions
diff --git a/backend/PrintAsm.ml b/backend/PrintAsm.ml
index f3c80f3e..9ffe3aa5 100644
--- a/backend/PrintAsm.ml
+++ b/backend/PrintAsm.ml
@@ -27,11 +27,10 @@ module Printer(Target:TARGET) =
let addr_mapping: (string, (int * int)) Hashtbl.t = Hashtbl.create 7
let get_fun_addr name =
- let name = extern_atom name in
- let start_addr = new_label ()
- and end_addr = new_label () in
- Hashtbl.add addr_mapping name (start_addr,end_addr);
- start_addr,end_addr
+ let s = Target.new_label ()
+ and e = Target.new_label () in
+ Debug.add_fun_addr name (e,s);
+ s,e
let print_debug_label oc l =
if !Clflags.option_g && Configuration.advanced_debug then
@@ -78,6 +77,7 @@ module Printer(Target:TARGET) =
List.iter (Target.print_init oc) id
let print_var oc name v =
+ if !Clflags.option_g && Configuration.advanced_debug then Target.add_var_location name;
match v.gvar_init with
| [] -> ()
| _ ->
@@ -102,8 +102,7 @@ module Printer(Target:TARGET) =
let sz =
match v.gvar_init with [Init_space sz] -> sz | _ -> assert false in
Target.print_comm_symb oc sz name align
-
-
+
let print_globdef oc (name,gdef) =
match gdef with
| Gfun (Internal code) -> print_function oc name code
@@ -119,7 +118,9 @@ 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 = try Some (Hashtbl.find addr_mapping s) with Not_found -> None
+ let get_location a = None
+ let get_frame_base a = None
+ let symbol = Target.symbol
end
module DebugPrinter = DwarfPrinter (DwarfTarget) (Target.DwarfAbbrevs)
@@ -138,7 +139,7 @@ let print_program oc p db =
close_filenames ();
if !Clflags.option_g && Configuration.advanced_debug then
begin
- match db with
+ match Debug.generate_debug_info () with
| None -> ()
| Some db ->
Printer.DebugPrinter.print_debug oc db
diff --git a/backend/PrintAsmaux.ml b/backend/PrintAsmaux.ml
index 13daa644..ed0fe524 100644
--- a/backend/PrintAsmaux.ml
+++ b/backend/PrintAsmaux.ml
@@ -51,6 +51,9 @@ module type TARGET =
val new_label: unit -> int
val label: out_channel -> int -> unit
val print_file_loc: out_channel -> file_loc -> unit
+ val get_location: P.t -> location_value option
+ val get_segment_location: P.t -> location_value option
+ val add_var_location: P.t -> unit
module DwarfAbbrevs: DWARF_ABBREVS
end
@@ -140,12 +143,6 @@ let coqint oc n =
fprintf oc "%ld" (camlint_of_coqint n)
(* Printing annotations in asm syntax *)
-(** All files used in the debug entries *)
-module StringSet = Set.Make(String)
-let all_files : StringSet.t ref = ref StringSet.empty
-let add_file file =
- all_files := StringSet.add file !all_files
-
let filename_info : (string, int * Printlines.filebuf option) Hashtbl.t
= Hashtbl.create 7