about summary refs log tree commit diff homepage
path: root/tools
AgeCommit message (Collapse)Author
2018-07-04Reorder linking and optimizationsMartin Nowack
Link intrinsic library before executing optimizations. This makes sure that any optimization run by KLEE on the module is executed for the intrinsic library as well. Support .ll files as input for KLEE as well.
2018-06-29fix out of range access in KleeHandler::getKTestFilesInDirFrank Busse
2018-05-24llvm: make KLEE compile against LLVM 3.7Richard Trembecký
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2018-05-08remove unused file: tools/klee/Debug.cppDaniel Schemmel
2018-05-05Fix handling of errno if external functions are invokedMartin Nowack
If an external function in KLEE is invoked, it might update errno. Previously, the errno specific variable in a state was only updated if it was part of the executed instructions. That opened up a timeframe that increased the likelihood of errno being overwritten by another method call. This patch fixes two issues: * the errno of the KLEE process state is updated before the external function call allowing to detect changes to it later on * after the external call, the memory object of errno is directly updated with its new value, reducing the likelihood to be overwritten by another call Additional features: * Add support for `errno()` for Darwin as well. * Simplified errno handling in POSIX layer
2018-04-28exitOnError no output buf fixZekun Shen
2018-03-01Store CexCache stats and then update klee-stats to use themDomenico Fabio Marino
Signed-off-by: Domenico Fabio Marino <nospamdomi@hotmail.it>
2017-11-30Implemented bounded merging functionalityLukas Wölfer
2017-10-04Remove Autoconf/Makefile build system and adjust the TravisCIDan Liew
configuration, TravisCI scripts and Dockerfile build appropriately. There are a bunch of clean ups this enables but this commit doesn't attempt them. We can do that in future commits.
2017-08-27Remove unnecessary null pointer checksOscar Deits
Fixes klee/klee#717 delete on null pointer is always safe.
2017-08-04Removed merging searchersLukas Wölfer
2017-08-01Fixed test case counter: Previously the number of test cases generated by ↵Andrea Mattavelli
KLEE was always incremented, even if a symbolic solution was not found.
2017-07-26This reverts incorrect patch ↵Cristian Cadar
https://github.com/klee/klee/commit/db29a0bba74b672cdf4b8fef4d94ffa6ab845e6d __fprintf_chk has a different prototype than fprintf
2017-07-23Remove support for LLVM < 3.4Martin Nowack
Request LLVM 3.4 as minimal requirement for KLEE
2017-07-18Merge pull request #672 from jirislaby/llvm40_static_castsAndrea Mattavelli
llvm: get rid of static_casts from iterators
2017-06-16move module loading into external functionJörg Thalheim
- having an explicit function which is defined for multiple llvm versions separately increases readability. - also: error handling was simplified - Personal motivation: being able to use this functionality in unit tests fixes #561 related to #656
2017-06-15llvm: get rid of static_casts from iteratorsJiri Slaby
In commit b7a6aec4eeb4 (convert iterators using static_cast), I switched all implicit casts to static_cast. It turned out that llvm 4.0 banned casting via static_cast. See e.g. 1e2bc42eb988 in the llvm repo what they do. So similarly to the above commit, change all the casts of iterators to "&*" which is what they do in LLVM. Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2017-06-12llvm: don't use clEnumValEnd for LLVM 4.0Jiri Slaby
It became unnecessary when defining options and mainly undefined. So introduce KLEE_LLVM_CL_VAL_END as suggested by @delcypher. Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2017-06-07llvm: rename ExitOnError to OptExitOnErrorJiri Slaby
ExitOnError collides with llvm::ExitOnError from LLVM 4: tools/klee/main.cpp:430:23: error: reference to 'ExitOnError' is ambiguous if (errorMessage && ExitOnError) { ^ /usr/include/llvm/Support/Error.h:938:7: note: candidate found by name lookup is 'llvm::ExitOnError' class ExitOnError { ^ klee/tools/klee/main.cpp:141:3: note: candidate found by name lookup is '(anonymous namespace)::ExitOnError' ExitOnError("exit-on-error", ^ 1 error generated. Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2017-06-01Refactor file opening code out of `main.cpp` and intoDan Liew
`klee_open_output_file()` function so that it can be used by the Z3Solver.
2017-05-24llvm: make KLEE compile against LLVM 3.5 and 3.6Richard Trembecký
Based on work by @ccadeptic23 and @delcypher. Formatting fixed by @snf. Fix compiler warning by @martijnthe. Further fixes by @mchalupa. Refactored, so that changes can be reviewed -- no massive changes in whitespace and in the surrounding code. Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2017-03-23Replace `llvm:errs()` with `klee_error()` as suggested by @andreamattavelliDan Liew
2017-03-23[WIP] Fix bug where stats would not be updated on early exit caused byDan Liew
finding a bug with the `-exit-on-error` option enabled.
2017-02-28convert iterators using static_castJiri Slaby
Newer versions of LLVM do not allow to implicitly cast iterators to pointers where they point. So convert all such uses to explicit static_cast, the same as LLVM code does. Otherwise we see errors like: lib/Core/Executor.cpp:548:15: error: no viable conversion from 'Module::iterator' (aka 'ilist_iterator<llvm::Function>') to 'llvm::Function *' Function *f = i; ^ ~ Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2017-02-25llvm: stop using global contextJiri Slaby
It was marked as deprecated long time ago and finally removed in LLVM 3.9. Remove all uses of getGlobalContext and create our own context. Propagate it all over the code then. [v2] use ctx, not C as name Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2017-01-16[CMake] Rename "integrationtests" to "systemtests".Dan Liew
This was a proposal from #500. @andreamattavelli pointed out that the lit tests are really system tests rather than integration tests so this commit fixes the inappropriate naming that I chose.
2016-12-02Fixed the issue of klee-stats not being copied to bin/Cristian Cadar
2016-12-01Added among the external calls that we modelAndrea Mattavelli
2016-11-23Renamed .pc to .kquery (kleaver query)Eric Rizzi
2016-11-18[CMake] Remove use of tabs in `CMakeLists.txt` files.Dan Liew
2016-11-18[CMake] Re-express LLVM and KLEE library dependencies asDan Liew
transitive dependencies on KLEE's libraries rather than on the final binaries. This is better because it means we can build other tools that use KLEE's libraries and not need to express the needed LLVM dependencies. It also makes it clearer what the dependencies are between KLEE libraries. This has illustrated a problem with the `kleeBasic` library. It contains `ConstructSolverChain.cpp` which clearly belongs in `kleaverSolver` not in `kleeBasic`. This will be fixed later.
2016-11-17[cmake] Build with newer JIT (for LLVM >= 3.6)Adrian Herrera
Links in the correct LLVM libraries when using the MCJIT. No effect for LLVM versions less than 3.6
2016-11-07Implement a CMake based build system for KLEE.Dan Liew
This is based off intial work by @jirislaby in #481. However it has been substantially modified. Notably it includes a separate build sytem to build the runtimes which is inspired by the old build system. The reason for doing this is because CMake is not well suited for building the runtime: * CMake is configured to use the host compiler, not the bitcode compiler. These are not the same thing. * Building the runtime using `add_custom_command()` is flawed because we can't automatically get transitive depencies (i.e. header file dependencies) unless the CMake generator is makefiles. (See `IMPLICIT_DEPENDS` of `add_custom_command()` in CMake). So for now we have a very simple build system for building the runtimes. In the future we can replace this with something more sophisticated if we need it. Support for all features of the old build system are implemented apart from recording the git revision and showing it in the output of `klee --help`. Another notable change is the CMake build system works much better with LLVM installs which don't ship with testing tools. The build system will download the sources for `FileCheck` and `not` tools if the corresponding binaries aren't available and will build them. However `lit` (availabe via `pip install lit`) and GTest must already be installed. Apart from better support for testing a significant advantage of the new CMake build system compared to the existing "Autoconf/Makefile" build system is that it is **not** coupled to LLVM's build system (unlike the existing build system). This means that LLVM's autoconf/Makefiles don't need to be installed somewhere on the system. Currently all tests pass. Support has been implemented in TravisCI and the Dockerfile for building with CMake. The existing "Autoconf/Makefile" build system has been left intact and so both build systems can coexist for a short while. We should remove the old build system as soon as possible though because it creates an unnecessary maintance burden.
2016-09-29Fixed the description of -posix-runtime optionAndrew Santosa
In the description, --sym-argv and --sym-argvs should have instead been --sym-arg and --sym-args
2016-09-26Modified logging information to steer the usage of klee_message, ↵Andrea Mattavelli
klee_warning, and klee_error
2016-09-16Avoid internalization of non-standard entry point (i.e. not the main ↵Andrea Mattavelli
function) (#455)
2016-09-15Check the existence of the entry point during the initialization of the ↵Andrea Mattavelli
POSIX runtime. If the check fails, exit with an error. (#457)
2016-08-08Use LLVM-based functions to print errnoAndrea Mattavelli
2016-07-08Support gzip-based compression of raw_outstreamsMartin Nowack
Provide initial zlib-based compression support for raw_outstreams. Replacing llvm::raw_fd_outstreams with compressed_fd_outstreams automatically compresses data in gzip format before writing to file. Options added: * --compress-log to compress all query log files (e.g. *.pc, *.smt2) on the fly. Every query log file gets extended with .gz. * --debug-compress-instructions to compress logfile for instruction stream on the fly.
2016-06-24Merge pull request #394 from andreamattavelli/refactoring_runindirCristian Cadar
Added error message for -run-in directory errors
2016-05-24Fixed bug #375 in Kleaver's parserAndrea Mattavelli
2016-05-24Added string for -run-in directory errorsAndrea Mattavelli
2016-05-20Allow relocation of installed klee treeDamir Shaykhutdinov
If klee is configured with certain bindir and runtime dir, allow klee to be relocated, as long as subdirectory structure remains intact. For example, if klee is configured with bindir /usr/bin, and with runtime dir /usr/lib/klee, but is relocated to certain directory $RDIR, then running $RDIR/usr/bin/klee will search for runtime libraries in $RDIR/usr/lib/klee. Klee will use global runtime directory only when installed to global binary directory. Inspired by relocation code in gcc.
2016-04-11Small refactoring to improve the consistency of info file handlingAndrea Mattavelli
2016-04-08Rename KLEE command line options fromDan Liew
* ``-replay-out`` to ``-replay-ktest-file`` * ``-replay-out-dir`` to ``-replay-ktest-dir`` and also rename * help descriptions * global variables corresponding to these options. * Names used in ``KleeHandler``, ``Interpreter``, ``Executor`` and in KLEE's ``main()`` function. The old name for the options/code was very unhelpful as it wasn't obvious that "out" files are ``.ktest`` files unless you examine KLEE's source code.
2016-04-08Remove dead function declarationDan Liew
2016-02-29Merge pull request #344 from MartinNowack/feat_mallocMartinNowack
Add support for tcmalloc
2016-02-27Merge pull request #345 from mdimjasevic/masterMartinNowack
Added missing copyright headers per klee/issue #301
2016-02-27Add support for tcmallocMartin Nowack
Beside improving performance of KLEE, tcmalloc allows to track used memory correctly. If available, tcmalloc is automatically used during compile time. This can be forced to be: - disabled using --without-tcmalloc - enabled using --with-tcmalloc In the second case, configure will fail if tcmalloc is not found or usable. Both versions of tcmalloc a minimal and normal version.
2016-02-25Added support to load libraries from command lineOmer Anson
This allows a user to invoke klee with specific libraries to load from command line. This is an attempt to allow klee to run on applications linked to external libraries. The libraries still have to be compiled specially for klee, in a manner similar to klee-uclibc, i.e. archives (build with llvm-ar) of llvm IR files.