aboutsummaryrefslogtreecommitdiffstats
path: root/backend/PrintAsm.ml
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2015-08-21 15:21:36 +0200
committerBernhard Schommer <bernhardschommer@gmail.com>2015-08-21 15:21:36 +0200
commit8d2e4a51d56b7f4d3673a5132edd1adb37a14295 (patch)
treeae812b2aea814c14c2c64a32c46ae14791e9dc25 /backend/PrintAsm.ml
parent5f798720574bf9d694da271e3e8bf699a4726497 (diff)
downloadcompcert-kvx-8d2e4a51d56b7f4d3673a5132edd1adb37a14295.tar.gz
compcert-kvx-8d2e4a51d56b7f4d3673a5132edd1adb37a14295.zip
Added symbol functions for printing of the location for global variables.
Diffstat (limited to 'backend/PrintAsm.ml')
-rw-r--r--backend/PrintAsm.ml8
1 files changed, 6 insertions, 2 deletions
diff --git a/backend/PrintAsm.ml b/backend/PrintAsm.ml
index f3c80f3e..29409b32 100644
--- a/backend/PrintAsm.ml
+++ b/backend/PrintAsm.ml
@@ -78,6 +78,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 +103,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
@@ -120,6 +120,10 @@ module Printer(Target:TARGET) =
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 = try (Target.get_location (stamp_atom a)) with Not_found -> None
+ let get_segment_location a = try (Target.get_segment_location (stamp_atom a)) with Not_found -> None
+ let get_frame_base a = None
+ let symbol = Target.symbol
end
module DebugPrinter = DwarfPrinter (DwarfTarget) (Target.DwarfAbbrevs)