diff options
author | Bernhard Schommer <bernhardschommer@gmail.com> | 2015-09-27 20:13:19 +0200 |
---|---|---|
committer | Bernhard Schommer <bernhardschommer@gmail.com> | 2015-09-27 20:13:19 +0200 |
commit | 91ed1b752d2661478840e40a0d977b068d99490d (patch) | |
tree | 5b0259e66fc0d35d335df6c1e36967c384ddf219 /debug/DwarfPrinter.ml | |
parent | 3e070cae6a316b7e3363c8159096c3bbc4bf21b2 (diff) | |
download | compcert-kvx-91ed1b752d2661478840e40a0d977b068d99490d.tar.gz compcert-kvx-91ed1b752d2661478840e40a0d977b068d99490d.zip |
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.
Diffstat (limited to 'debug/DwarfPrinter.ml')
-rw-r--r-- | debug/DwarfPrinter.ml | 14 |
1 files changed, 7 insertions, 7 deletions
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 |