From 91ed1b752d2661478840e40a0d977b068d99490d Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Sun, 27 Sep 2015 20:13:19 +0200 Subject: Added printing the reference address for the LocRef and started refactoring old Debuging code. The old functions to store the symbol for the Global variables and retrive this is no longer needed since the atom is stored in DebugInformation. Also the Debug.Abbrev module is no longer needed. --- debug/DwarfPrinter.ml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'debug/DwarfPrinter.ml') diff --git a/debug/DwarfPrinter.ml b/debug/DwarfPrinter.ml index 3e98f0dd..13c0640d 100644 --- a/debug/DwarfPrinter.ml +++ b/debug/DwarfPrinter.ml @@ -19,14 +19,13 @@ open PrintAsmaux open Sections (* The printer is parameterized over target specific functions and a set of dwarf type constants *) -module DwarfPrinter(Target: DWARF_TARGET)(DwarfAbbrevs:DWARF_ABBREVS): +module DwarfPrinter(Target: DWARF_TARGET): sig val print_debug: out_channel -> dw_entry -> dw_locations -> unit end = struct open Target - open DwarfAbbrevs (* Byte value to string *) let string_of_byte value = @@ -318,6 +317,11 @@ module DwarfPrinter(Target: DWARF_TARGET)(DwarfAbbrevs:DWARF_ABBREVS): print_byte oc dw_op_regx; print_uleb128 oc i end + + + let print_ref oc r = + let ref = entry_to_label r in + fprintf oc " .4byte %a\n" label ref let print_loc oc loc = match loc with @@ -332,7 +336,7 @@ module DwarfPrinter(Target: DWARF_TARGET)(DwarfAbbrevs:DWARF_ABBREVS): let size = List.fold_left (fun acc a -> acc + size_of_loc_expr a) 0 e in print_sleb128 oc size; List.iter (print_loc_expr oc) e - | _ -> () + | LocRef f -> print_ref oc f let print_data_location oc dl = match dl with @@ -340,10 +344,6 @@ module DwarfPrinter(Target: DWARF_TARGET)(DwarfAbbrevs:DWARF_ABBREVS): print_loc_expr oc e | _ -> () - let print_ref oc r = - let ref = entry_to_label r in - fprintf oc " .4byte %a\n" label ref - let print_addr oc a = fprintf oc " .4byte %a\n" label a -- cgit