From 253e8e9b72a1204f334460af0ffc7893d3e4b752 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Thu, 19 Mar 2015 11:18:10 +0100 Subject: Activating the printing of the debug information for supported architecture. --- debug/CtoDwarf.ml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'debug/CtoDwarf.ml') diff --git a/debug/CtoDwarf.ml b/debug/CtoDwarf.ml index b7f417f6..206061b6 100644 --- a/debug/CtoDwarf.ml +++ b/debug/CtoDwarf.ml @@ -111,7 +111,7 @@ let rec type_to_dwarf (typ: typ): int * dw_entry list = Some ret,et) in let prototyped,children,others = (match args with - | None -> + | None -> let u = { unspecified_parameter_file_loc = None; unspecified_parameter_artificial = None; @@ -182,3 +182,21 @@ let rec type_to_dwarf (typ: typ): int * dw_entry list = Hashtbl.add type_table typ_string id; id,entries +let rec globdecl_to_dwarf decl = + match decl.gdesc with + | Gtypedef (n,t) -> let i,t = type_to_dwarf t in + Hashtbl.add defined_types_table n.name i; + t + | Gpragma _ + | _ -> [] + +let program_to_dwarf prog name = + Hashtbl.reset type_table; + Hashtbl.reset defined_types_table; + reset_id (); + let defs = List.concat (List.map globdecl_to_dwarf prog) in + let cp = { + compile_unit_name = name; + } in + let cp = new_entry (DW_TAG_compile_unit cp) in + add_children cp defs -- cgit