From 05acff8bcb4f127a6f0ff6c587ba38d1c8cbe2fc Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Tue, 29 Sep 2015 18:35:36 +0200 Subject: More fixes for the DebugInformation. Changed the sizeof function to take into account the bytes needed for the sleb128/uleb128 encoding of the DW_OP_* arguments and changed the end_live_range function to only close functions where the live range is currently open. --- debug/DwarfPrinter.ml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'debug/DwarfPrinter.ml') diff --git a/debug/DwarfPrinter.ml b/debug/DwarfPrinter.ml index aa1c187f..a95c71a1 100644 --- a/debug/DwarfPrinter.ml +++ b/debug/DwarfPrinter.ml @@ -303,12 +303,6 @@ module DwarfPrinter(Target: DWARF_TARGET): print_uleb128 oc col | None -> () - let size_of_loc_expr = function - | DW_OP_bregx _ -> 3 - | DW_OP_plus_uconst _ -> 2 - | DW_OP_piece _ -> 2 - | DW_OP_reg i -> if i < 32 then 1 else 2 - let print_loc_expr oc = function | DW_OP_bregx (a,b) -> print_byte oc dw_op_bregx; @@ -316,7 +310,7 @@ module DwarfPrinter(Target: DWARF_TARGET): fprintf oc " .sleb128 %ld\n" b | DW_OP_plus_uconst i -> print_byte oc dw_op_plus_uconst; - print_byte oc i + print_uleb128 oc i | DW_OP_piece i -> print_byte oc dw_op_piece; print_uleb128 oc i @@ -360,6 +354,7 @@ module DwarfPrinter(Target: DWARF_TARGET): let print_data_location oc dl = match dl with | DataLocBlock e -> + print_sleb128 oc (size_of_loc_expr e); print_loc_expr oc e | _ -> () -- cgit