summaryrefslogtreecommitdiff
path: root/checklink/Validator.ml
diff options
context:
space:
mode:
authorGravatar varobert <varobert@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2012-04-04 11:59:38 +0000
committerGravatar varobert <varobert@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2012-04-04 11:59:38 +0000
commit9f9b003697ac901008affd7008c428109d1afc5e (patch)
treeeaf164d26cf44ba5d986f9c3c2375b97211002df /checklink/Validator.ml
parent3d8c8ffbcaa07b6b421c75298a25887875a78c34 (diff)
Better fuzzing options
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1868 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'checklink/Validator.ml')
-rw-r--r--checklink/Validator.ml32
1 files changed, 20 insertions, 12 deletions
diff --git a/checklink/Validator.ml b/checklink/Validator.ml
index f91a131..c413c75 100644
--- a/checklink/Validator.ml
+++ b/checklink/Validator.ml
@@ -6,6 +6,7 @@ open Fuzz
let elf_file = ref (None: string option)
let sdump_files = ref ([] : string list)
let option_fuzz = ref false
+let option_bytefuzz = ref false
let option_printelf = ref false
let set_elf_file s =
@@ -14,20 +15,24 @@ let set_elf_file s =
| Some _ -> raise (Arg.Bad "multiple ELF executables given on command line")
let options = [
+ "-exe <filename>", Arg.String set_elf_file,
+ "Specify the ELF executable file to analyze";
+ "-debug", Arg.Set Check.debug,
+ "Print a detailed trace of verification";
+ "-noexhaust", Arg.Clear Check.exhaustivity,
+ "Disable the exhaustivity check of ELF function and data symbols";
"-printelf", Arg.Set option_printelf,
- "Print the contents of the unanalyzed ELF executable";
+ "Print the contents of the unanalyzed ELF executable";
"-printelfmap", Arg.Set Check.print_elfmap,
- "Print a map of the analyzed ELF executable";
- "-debug", Arg.Set Check.debug,
- "Print a detailed trace of verification";
+ "Print a map of the analyzed ELF executable";
"-dumpelfmap", Arg.Set Check.dump_elfmap,
- "Dump an ELF map to <exename>.elfmap, for use with random fuzzing";
- "-exe <filename>", Arg.String set_elf_file,
- "Specify the ELF executable file to analyze";
+ "Dump an ELF map to <exename>.elfmap, for use with random fuzzing";
"-fuzz", Arg.Set option_fuzz,
- "Random fuzzing test";
- "-noexhaust", Arg.Clear Check.exhaustivity,
- "Disable the exhaustivity check of ELF function and data symbols"
+ "Random fuzz testing";
+ "-bytefuzz", Arg.Set option_bytefuzz,
+ "Random fuzz testing byte per byte";
+ "-debugfuzz", Arg.Set Fuzz.fuzz_debug,
+ "Print a detailed trace of ongoing fuzz testing";
]
let anonymous arg =
@@ -37,7 +42,7 @@ let anonymous arg =
set_elf_file arg
let usage =
-"The CompCert C post-linking validator, version " ^ Configuration.version ^ "
+ "The CompCert C post-linking validator, version " ^ Configuration.version ^ "
Usage: cchecklink [options] <.sdump files> <ELF executable>
In the absence of options, checks are performed and a short result is displayed.
Options are:"
@@ -50,7 +55,10 @@ let _ =
exit 2
| Some elffilename ->
let sdumps = List.rev !sdump_files in
- if !option_fuzz then begin
+ if !option_bytefuzz then begin
+ Random.self_init();
+ fuzz_every_byte_loop elffilename sdumps
+ end else if !option_fuzz then begin
Random.self_init();
fuzz_loop elffilename sdumps
end else if !option_printelf then begin