aboutsummaryrefslogtreecommitdiffstats
path: root/backend/PrintAsm.ml
diff options
context:
space:
mode:
Diffstat (limited to 'backend/PrintAsm.ml')
-rw-r--r--backend/PrintAsm.ml19
1 files changed, 10 insertions, 9 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