diff options
Diffstat (limited to 'debug')
-rw-r--r-- | debug/Debug.ml | 2 | ||||
-rw-r--r-- | debug/Debug.mli | 2 | ||||
-rw-r--r-- | debug/DwarfPrinter.ml | 6 | ||||
-rw-r--r-- | debug/DwarfUtil.ml | 6 | ||||
-rw-r--r-- | debug/Dwarfgen.ml | 11 |
5 files changed, 17 insertions, 10 deletions
diff --git a/debug/Debug.ml b/debug/Debug.ml index 87d04ad7..789ecb70 100644 --- a/debug/Debug.ml +++ b/debug/Debug.ml @@ -20,7 +20,7 @@ open Sections (* Interface for generating and printing debug information *) -(* Record used for stroring references to the actual implementation functions *) +(* Record used for storing references to the actual implementation functions *) type implem = { init: string -> unit; diff --git a/debug/Debug.mli b/debug/Debug.mli index 1585e7e4..614fe84b 100644 --- a/debug/Debug.mli +++ b/debug/Debug.mli @@ -18,7 +18,7 @@ open BinNums open Sections -(* Record used for stroring references to the actual implementation functions *) +(* Record used for storing references to the actual implementation functions *) type implem = { init: string -> unit; diff --git a/debug/DwarfPrinter.ml b/debug/DwarfPrinter.ml index 3e85ecfc..7469c4af 100644 --- a/debug/DwarfPrinter.ml +++ b/debug/DwarfPrinter.ml @@ -623,8 +623,10 @@ module DwarfPrinter(Target: DWARF_TARGET): let name = if e.section_name <> ".text" then Some e.section_name else None in section oc (Section_debug_info name); print_debug_info oc e.start_label e.line_label e.entry) entries; - section oc Section_debug_loc; - List.iter (fun e -> print_location_list oc e.locs) entries + if List.exists (fun e -> match e.locs with _,[] -> false | _,_ -> true) entries then begin + section oc Section_debug_loc; + List.iter (fun e -> print_location_list oc e.locs) entries + end let print_ranges oc r = section oc Section_debug_ranges; diff --git a/debug/DwarfUtil.ml b/debug/DwarfUtil.ml index 3e252dd2..8db80fca 100644 --- a/debug/DwarfUtil.ml +++ b/debug/DwarfUtil.ml @@ -10,7 +10,7 @@ (* *) (* *********************************************************************) -(* Utility functions for the dwarf debuging type *) +(* Utility functions for the dwarf debugging type *) open DwarfTypes @@ -22,12 +22,12 @@ let new_entry id tag = id = id; } -(* Add an entry as child to another entry *) +(* Add an entry as child to another entry *) let add_child entry child = {entry with children = child::entry.children;} -(* Add entries as children to another entry *) +(* Add entries as children to another entry *) let add_children entry children = {entry with children = entry.children@children;} diff --git a/debug/Dwarfgen.ml b/debug/Dwarfgen.ml index 56a318fe..d198a92f 100644 --- a/debug/Dwarfgen.ml +++ b/debug/Dwarfgen.ml @@ -475,9 +475,14 @@ module Dwarfgenaux (Target: TARGET) = let f_id = get_opt_val f.fun_atom in let acc = match f.fun_return_type with Some s -> acc =<< s | None -> acc in let f_entry = new_entry id (DW_TAG_subprogram f_tag) in - let params,acc = mmap (function_parameter_to_entry f_id) acc f.fun_parameter in - let vars,acc = fun_scope_to_entries f_id acc f.fun_scope in - add_children f_entry (params@vars),acc + let children,acc = + if not !Clflags.option_gglobal then + let params,acc = mmap (function_parameter_to_entry f_id) acc f.fun_parameter in + let vars,acc = fun_scope_to_entries f_id acc f.fun_scope in + params@vars,acc + else + [],acc in + add_children f_entry (children),acc let definition_to_entry acc id t = match t with |