aboutsummaryrefslogtreecommitdiffstats
path: root/debug/DwarfPrinter.ml
diff options
context:
space:
mode:
Diffstat (limited to 'debug/DwarfPrinter.ml')
-rw-r--r--debug/DwarfPrinter.ml6
1 files changed, 4 insertions, 2 deletions
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;