From b3de120011683866149ac2a9fbd0da38e2eef96c Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Mon, 30 Mar 2015 16:37:32 +0200 Subject: Added more comments and fixed issue in DwarfPrinter.mli --- debug/DwarfPrinter.mli | 18 ++++++++++++++++++ debug/DwarfTypes.mli | 3 ++- debug/DwarfUtil.ml | 10 +--------- 3 files changed, 21 insertions(+), 10 deletions(-) create mode 100644 debug/DwarfPrinter.mli (limited to 'debug') diff --git a/debug/DwarfPrinter.mli b/debug/DwarfPrinter.mli new file mode 100644 index 00000000..9e0e6693 --- /dev/null +++ b/debug/DwarfPrinter.mli @@ -0,0 +1,18 @@ +(* *********************************************************************) +(* *) +(* The Compcert verified compiler *) +(* *) +(* Bernhard Schommer, AbsInt Angewandte Informatik GmbH *) +(* *) +(* AbsInt Angewandte Informatik GmbH. All rights reserved. This file *) +(* is distributed under the terms of the INRIA Non-Commercial *) +(* License Agreement. *) +(* *) +(* *********************************************************************) + +open DwarfTypes + +module DwarfPrinter: functor (Target: DWARF_TARGET) -> functor (DwarfAbbrevs: DWARF_ABBREVS) -> + sig + val print_debug: out_channel -> dw_entry -> unit + end diff --git a/debug/DwarfTypes.mli b/debug/DwarfTypes.mli index d4fb0df9..c02558b5 100644 --- a/debug/DwarfTypes.mli +++ b/debug/DwarfTypes.mli @@ -228,7 +228,7 @@ type dw_entry = id: reference; } - +(* Module type for a matching from type to dwarf encoding *) module type DWARF_ABBREVS = sig val sibling_type_abbr: int @@ -259,6 +259,7 @@ module type DWARF_ABBREVS = val bound_ref_type_abbr: int end +(* The target specific functions for printing the debug information *) module type DWARF_TARGET= sig val label: out_channel -> int -> unit diff --git a/debug/DwarfUtil.ml b/debug/DwarfUtil.ml index fe4a0f7b..e2c87a9d 100644 --- a/debug/DwarfUtil.ml +++ b/debug/DwarfUtil.ml @@ -63,15 +63,6 @@ let rec entry_fold f acc entry = let acc = f acc entry.tag in List.fold_left (entry_fold f) acc entry.children -let rec entry_map f entry = - let t = f entry.tag in - let children = List.map (entry_map f) entry.children in - { - entry with - tag = t; - children = children; - } - (* Attribute form encoding *) let dw_form_addr = 0x01 let dw_form_block2 = 0x03 @@ -95,6 +86,7 @@ let dw_form_ref8 = 0x14 let dw_ref_udata = 0x15 let dw_ref_indirect = 0x16 +(* Default corresponding encoding for the different abbreviations *) module DefaultAbbrevs = struct let sibling_type_abbr = dw_form_ref4 -- cgit