diff options
author | Bernhard Schommer <bernhardschommer@gmail.com> | 2015-09-25 21:12:48 +0200 |
---|---|---|
committer | Bernhard Schommer <bernhardschommer@gmail.com> | 2015-09-25 21:12:48 +0200 |
commit | 3e070cae6a316b7e3363c8159096c3bbc4bf21b2 (patch) | |
tree | 18de89977f0b89d18922d54f3c600d09092d580b /debug/DwarfPrinter.ml | |
parent | aff813685455559f6d6a88158dd3d605893ba3a3 (diff) | |
download | compcert-kvx-3e070cae6a316b7e3363c8159096c3bbc4bf21b2.tar.gz compcert-kvx-3e070cae6a316b7e3363c8159096c3bbc4bf21b2.zip |
Added translation of the range lists to location entries.
Diffstat (limited to 'debug/DwarfPrinter.ml')
-rw-r--r-- | debug/DwarfPrinter.ml | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/debug/DwarfPrinter.ml b/debug/DwarfPrinter.ml index 5f459a57..3e98f0dd 100644 --- a/debug/DwarfPrinter.ml +++ b/debug/DwarfPrinter.ml @@ -298,7 +298,8 @@ module DwarfPrinter(Target: DWARF_TARGET)(DwarfAbbrevs:DWARF_ABBREVS): | 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; @@ -310,6 +311,13 @@ module DwarfPrinter(Target: DWARF_TARGET)(DwarfAbbrevs:DWARF_ABBREVS): | DW_OP_piece i -> print_byte oc dw_op_piece; print_uleb128 oc i + | DW_OP_reg i -> + if i < 32 then + print_byte oc (dw_op_reg0 + i) + else begin + print_byte oc dw_op_regx; + print_uleb128 oc i + end let print_loc oc loc = match loc with @@ -544,6 +552,7 @@ module DwarfPrinter(Target: DWARF_TARGET)(DwarfAbbrevs:DWARF_ABBREVS): fprintf oc " .4byte 0\n" let print_location_list oc l = + fprintf oc" .section %s\n" (name_of_section Section_debug_loc); List.iter (print_location_entry oc) l (* Print the debug info and abbrev section *) |