From a3fed0c150fedac94470e99864732a2dd7e9002d Mon Sep 17 00:00:00 2001 From: Mark Hakansson <mark.hakansson@live.se> Date: Fri, 12 Feb 2021 10:09:22 +0100 Subject: [PATCH] Add an option to set all klee CLI flags/options --- cargo-klee/src/main.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cargo-klee/src/main.rs b/cargo-klee/src/main.rs index c3b3c79..1acf11f 100644 --- a/cargo-klee/src/main.rs +++ b/cargo-klee/src/main.rs @@ -97,6 +97,13 @@ fn run() -> Result<i32, failure::Error> { .short("g") .help("Run the generated replay binary in `gdb`. The environment variable `GDB_CWD` determines the `gdb` working directory, if unset `gdb` will execute in the current working directory"), ) + // This needs to be the last argument! + .arg( + Arg::with_name("options") + .takes_value(true) + .raw(true) + .help("Add native `klee` CLI options after the sequence `--`. See `klee --help` for all available options.") + ) .get_matches(); let is_example = matches.is_present("example"); @@ -278,6 +285,12 @@ fn run() -> Result<i32, failure::Error> { // klee analysis if is_ktest || !is_replay { let mut klee = Command::new("klee"); + // Check for additional KLEE options which will be sent to `klee` + if let Some(klee_options) = matches.values_of("options") { + for option in klee_options { + klee.arg(option); + } + } klee // ll file to analyse .arg(ll.unwrap()); -- GitLab