Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 18 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,28 @@ Sound Static Analysis of C for Memory Safety (Undefined Behavior)
### Quick start

The CodeHawk-C Analyzer consists of two parts:
- A python front end (this repository) through which all user interaction
- A Python front end (this repository) through which all user interaction
is performed, and
- An ocaml abstract-interpretation engine that powers the analysis.
- An OCaml abstract-interpretation engine that powers the analysis.

To use the CodeHawk-C Analyzer first clone or download the ocaml application
To use the CodeHawk-C Analyzer first clone or download the OCaml application
from
```
https://github.com/static-analysis-engineering/codehawk
```
and build according to the accompanying instructions given there.
Then copy the following files from that build:
```
codehawk/CodeHawk/CHC/cchcil/parseFile
codehawk/CodeHawk/CHC/cchcmdline/canalyzer
```
to the following location in this repository:
```
CodeHawk-C/chc/bin/linux/
```
or
```
CodeHawk-C/chc/bin/macOS
```
depending on the platform where the executables were built.
Alternatively, you can edit the path to these two executables directly
in chc/util/Config.py or chc/util/ConfigLocal.py, so there is no need
to copy them or update them with each new version of the ocaml analyzer.
and build with `dune` according to the accompanying instructions given there.

You can either:
- Copy `chc/util/ConfigLocal.template` to `chc/util/ConfigLocal.py`
in this repository, and edit the latter file to set the paths for
`config.canalyzer` and `config.cparser` to the `dune`-built binaries,
which should be in `your-path-to-codehawk/CodeHawk/_build/install/default/bin/`.
This allows CodeHawk-C to automatically use newly-built versions of the
OCaml analyzer.
- Or, you can copy the `canalyzer` and `parseFile` binaries from that location
into `chc/bin/linux/` or `chc/bin/macOS` within this repository.
To allow CodeHawk-C to use newly-built versions of the OCaml analyzer,
you will have to re-copy the binaries after every build.

Set the python path and path:
```
Expand All @@ -47,8 +42,8 @@ which should show something like:
Analyzer configuration:
-----------------------
platform : linux
parser : /home/user/codehawk/CodeHawk/CHC/cchcil/parseFile (found)
analyzer : /home/user/codehawk/CodeHawk/CHC/cchcmdline/canalyzer (found)
parser : /home/user/codehawk/CodeHawk/_build/install/default/bin/parseFile (found)
analyzer : /home/user/codehawk/CodeHawk/_build/install/default/bin/canalyzer (found)

summaries: /home/user/CodeHawk-C/chc/summaries/cchsummaries.jar (found)
```
Expand Down
2 changes: 0 additions & 2 deletions chc/util/ConfigLocal.template
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,4 @@ def getLocals(config: chc.util.Config.Config) -> None:
config.canalyzer = '/home/username/my-analyzer/canalyzer'
config.cparser = '/home/username/my-parser/parseFile'
config.summaries = '/home/username/my-summaries/cchsummaries.jar'
config.bear = '/home/username/bear-home/bear'
config.libear = '/home/username/bear-home/libear.so'
'''
Loading