aboutsummaryrefslogtreecommitdiffstats
path: root/debug
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2015-09-28 09:48:07 +0200
committerBernhard Schommer <bernhardschommer@gmail.com>2015-09-28 09:48:07 +0200
commit89476ea80ecfc7af02ef5026d0f45b61d243e3b0 (patch)
tree0a5e5497510a9c436168e75beeff9d9c2d78f13d /debug
parentf2350a3a112950bea11af821754d8f674dda9f9e (diff)
downloadcompcert-kvx-89476ea80ecfc7af02ef5026d0f45b61d243e3b0.tar.gz
compcert-kvx-89476ea80ecfc7af02ef5026d0f45b61d243e3b0.zip
Changed the size expression to 2byte for debug_loc entries.
Diffstat (limited to 'debug')
-rw-r--r--debug/DwarfPrinter.ml19
1 files changed, 18 insertions, 1 deletions
diff --git a/debug/DwarfPrinter.ml b/debug/DwarfPrinter.ml
index 13c0640d..63ba4cd0 100644
--- a/debug/DwarfPrinter.ml
+++ b/debug/DwarfPrinter.ml
@@ -292,6 +292,9 @@ module DwarfPrinter(Target: DWARF_TARGET):
let print_byte oc b =
fprintf oc " .byte 0x%X\n" b
+ let print_2byte oc b =
+ fprintf oc " .2byte 0x%X\n" b
+
let size_of_loc_expr = function
| DW_OP_bregx _ -> 3
@@ -338,6 +341,20 @@ module DwarfPrinter(Target: DWARF_TARGET):
List.iter (print_loc_expr oc) e
| LocRef f -> print_ref oc f
+ let print_list_loc oc = function
+ | LocSymbol s ->
+ print_2byte oc 5;
+ print_byte oc dw_op_addr;
+ fprintf oc " .4byte %a\n" symbol s
+ | LocSimple e ->
+ print_2byte oc (size_of_loc_expr e);
+ print_loc_expr oc e
+ | LocList e ->
+ let size = List.fold_left (fun acc a -> acc + size_of_loc_expr a) 0 e in
+ print_2byte oc size;
+ List.iter (print_loc_expr oc) e
+ | LocRef f -> print_ref oc f
+
let print_data_location oc dl =
match dl with
| DataLocBlock e ->
@@ -547,7 +564,7 @@ module DwarfPrinter(Target: DWARF_TARGET):
List.iter (fun (b,e,loc) ->
fprintf oc " .4byte %a-%a\n" label b label c_low;
fprintf oc " .4byte %a-%a\n" label e label c_low;
- print_loc oc loc) l.loc;
+ print_list_loc oc loc) l.loc;
fprintf oc " .4byte 0\n";
fprintf oc " .4byte 0\n"