aboutsummaryrefslogtreecommitdiffstats
path: root/driver/Driver.ml
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2017-06-26 17:18:50 +0200
committerBernhard Schommer <bernhardschommer@gmail.com>2017-06-26 17:18:50 +0200
commit1530f96aa259f346f235de713ab53b682b6d82f6 (patch)
treed5377537033e473813033e20e86bfefa11ebb8e8 /driver/Driver.ml
parent66ba0d63b25bab2a682c92c5a277c190b6c4c847 (diff)
downloadcompcert-1530f96aa259f346f235de713ab53b682b6d82f6.tar.gz
compcert-1530f96aa259f346f235de713ab53b682b6d82f6.zip
Added a little bit more compilation info to sdump.
The additional compilation information contains the file, command line (after @-file expansion) and the current working directory. Bug 21690
Diffstat (limited to 'driver/Driver.ml')
-rw-r--r--driver/Driver.ml11
1 files changed, 9 insertions, 2 deletions
diff --git a/driver/Driver.ml b/driver/Driver.ml
index 310e4209..97082720 100644
--- a/driver/Driver.ml
+++ b/driver/Driver.ml
@@ -29,8 +29,15 @@ let jdump_magic_number = "CompCertJDUMP" ^ Version.version
let dump_jasm asm sourcename destfile =
let oc = open_out_bin destfile in
- fprintf oc "{\n\"Version\":\"%s\",\n\"System\":\"%s\"\n,\"Compilation Unit\":\"%s\",\n\"Asm Ast\":%a}"
- jdump_magic_number Configuration.system sourcename AsmToJSON.p_program asm;
+ let print_args oc =
+ output_string oc Sys.executable_name;
+ for i = 1 to (Array.length !argv - 1) do
+ fprintf oc " %s" (Responsefile.gnu_quote !argv.(i))
+ done in
+ let dump_compile_info oc =
+ fprintf oc "{\n\"directory\":\"%s\",\n\"command\":\"%t\",\n\"file\":\"%s\"\n}" (Sys.getcwd ()) print_args sourcename in
+ fprintf oc "{\n\"Version\":\"%s\",\n\"System\":\"%s\"\n,\"Compile Info\" : %t,\n\"Compilation Unit\":\"%s\",\n\"Asm Ast\":%a}"
+ jdump_magic_number Configuration.system dump_compile_info sourcename AsmToJSON.p_program asm;
close_out oc