aboutsummaryrefslogtreecommitdiffstats
path: root/debug
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2017-03-20 13:12:16 +0100
committerBernhard Schommer <bernhardschommer@gmail.com>2017-03-20 13:12:16 +0100
commit361253d66fde0eb79d3fde7cc272e43689768ee7 (patch)
treec7defd7e8e935a341677e54ee40f1c1a50feb650 /debug
parent5bfa0059a144fb4333bbfecaa74690ba92a879ce (diff)
downloadcompcert-kvx-361253d66fde0eb79d3fde7cc272e43689768ee7.tar.gz
compcert-kvx-361253d66fde0eb79d3fde7cc272e43689768ee7.zip
Better fix for problems with quoting in files.
Instead of using Filename.quote, string entries are printed with %S. Bug 21216
Diffstat (limited to 'debug')
-rw-r--r--debug/DwarfPrinter.ml4
-rw-r--r--debug/Dwarfgen.ml4
2 files changed, 4 insertions, 4 deletions
diff --git a/debug/DwarfPrinter.ml b/debug/DwarfPrinter.ml
index 13e7765d..bfd43b0b 100644
--- a/debug/DwarfPrinter.ml
+++ b/debug/DwarfPrinter.ml
@@ -307,7 +307,7 @@ module DwarfPrinter(Target: DWARF_TARGET):
let print_string oc c = function
| Simple_string s ->
- fprintf oc " .asciz \"%s\"%a\n" s print_comment c
+ fprintf oc " .asciz %S%a\n" s print_comment c
| Offset_string (o,s) ->
let c = sprintf "%s %s" c s in
print_loc_ref oc c o
@@ -661,7 +661,7 @@ module DwarfPrinter(Target: DWARF_TARGET):
let s = List.sort (fun (a,_) (b,_) -> Pervasives.compare a b) s in
List.iter (fun (id,s) ->
print_label oc (loc_to_label id);
- fprintf oc " .asciz \"%s\"\n" s) s)
+ fprintf oc " .asciz %S\n" s) s)
(* Print the debug info and abbrev section *)
diff --git a/debug/Dwarfgen.ml b/debug/Dwarfgen.ml
index ca5d783d..ee568042 100644
--- a/debug/Dwarfgen.ml
+++ b/debug/Dwarfgen.ml
@@ -549,7 +549,7 @@ let diab_gen_compilation_section s defs acc =
let cp = {
compile_unit_name = Simple_string !file_name;
compile_unit_range = Pc_pair (low_pc,high_pc);
- compile_unit_dir = Simple_string (Filename.quote (Sys.getcwd ()));
+ compile_unit_dir = Simple_string (Sys.getcwd ());
compile_unit_prod_name = Simple_string prod_name
} in
let cp = new_entry (next_id ()) (DW_TAG_compile_unit cp) in
@@ -620,7 +620,7 @@ let gen_gnu_debug_info sec_name var_section : debug_entries =
let cp = {
compile_unit_name = gnu_string_entry !file_name;
compile_unit_range = r;
- compile_unit_dir = gnu_string_entry (Filename.quote (Sys.getcwd ()));
+ compile_unit_dir = gnu_string_entry (Sys.getcwd ());
compile_unit_prod_name = gnu_string_entry prod_name;
} in
let cp = new_entry (next_id ()) (DW_TAG_compile_unit cp) in