aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2014-11-15 10:22:55 +0100
committerXavier Leroy <xavier.leroy@inria.fr>2014-11-15 10:22:55 +0100
commitf15e5f77cb751c2c3065e0587c790bfb598d02d6 (patch)
tree5bece5cb088e7f29ae590f6c864cc601d5e556fc
parenta49d3b267754eae6036e0c03e48bff7e1c028a58 (diff)
downloadcompcert-kvx-f15e5f77cb751c2c3065e0587c790bfb598d02d6.tar.gz
compcert-kvx-f15e5f77cb751c2c3065e0587c790bfb598d02d6.zip
cchecklink: added option "-files-from" to read .sdump file names
from a file or from standard input.
-rw-r--r--Changelog3
-rw-r--r--checklink/Validator.ml30
2 files changed, 29 insertions, 4 deletions
diff --git a/Changelog b/Changelog
index 4b102d78..87b2174f 100644
--- a/Changelog
+++ b/Changelog
@@ -1,7 +1,8 @@
- In string and character literals, treat illegal escape sequences
(e.g. "\%" or "\0") as an error instead of a warning.
- Upgraded Flocq to version 2.4.0.
-
+- cchecklink: added option "-files-from" to read .sdump file names
+ from a file or from standard input.
Release 2.4, 2014-09-17
=======================
diff --git a/checklink/Validator.ml b/checklink/Validator.ml
index baf06fca..6969409a 100644
--- a/checklink/Validator.ml
+++ b/checklink/Validator.ml
@@ -22,6 +22,27 @@ let set_conf_file s =
| Some _ -> raise (Arg.Bad "multiple configuration files given on command line")
end
+let read_sdumps_from_channel ic =
+ try
+ while true do
+ let l = input_line ic in
+ if l <> "" then sdump_files := l :: !sdump_files
+ done
+ with End_of_file ->
+ ()
+
+let read_sdumps_from_file f =
+ if f = "-" then
+ read_sdumps_from_channel stdin
+ else begin
+ try
+ let ic = open_in f in
+ read_sdumps_from_channel ic;
+ close_in ic
+ with Sys_error msg ->
+ Printf.eprintf "Error reading file: %s\n" msg; exit 2
+ end
+
let option_disassemble = ref false
let disassemble_list = ref ([]: string list)
let add_disassemble s =
@@ -31,12 +52,15 @@ let add_disassemble s =
let options = [
(* Main options *)
"-exe", Arg.String set_elf_file,
- "<filename> Specify the ELF executable file to analyze";
+ "<filename> Specify the ELF executable file to analyze";
"-conf", Arg.String set_conf_file,
- "<filename> Specify a configuration file";
+ "<filename> Specify a configuration file";
+ "-files-from", Arg.String read_sdumps_from_file,
+ "<filename> Read names of .sdump files from the given file\n\
+ \t(or from standard input if <filename> is '-')";
(* Parsing behavior *)
"-relaxed", Arg.Set ELF_parsers.relaxed,
- "Allows the following behaviors in the ELF parser:
+ "Allows the following behaviors in the ELF parser:\n\
\t* Use of a fallback heuristic to resolve symbols bootstrapped at load time";
(* Printing behavior *)
"-no-exhaustive", Arg.Clear Check.exhaustivity,