Skip to content

Commit 6bf932f

Browse files
committed
Update Agent file
Signed-off-by: Herbert Rocha <herberthb12@gmail.com>
1 parent e9de61a commit 6bf932f

1 file changed

Lines changed: 29 additions & 10 deletions

File tree

‎CLAUDE.md‎

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,40 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
44

55
## What is Map2Check
66

7-
Map2Check is a bug-hunting tool that automatically generates and checks safety properties in C programs. It tracks memory pointers and variable assignments to check user-specified assertions, overflow, and pointer safety. It uses LLVM 6.0, LibFuzzer, and KLEE for test case generation, and Crab-LLVM for computing inductive invariants.
7+
Map2Check is a bug-hunting tool that automatically generates and checks safety properties in C programs. It tracks memory pointers and variable assignments to check user-specified assertions, overflow, and pointer safety. It uses LLVM 16, LibFuzzer, and KLEE 3.1 for test case generation.
88

99
## Build System
1010

11-
The project uses **CMake 3.20+ + Ninja** and **C++17**. The intended build environment is the Docker image defined in [Dockerfile](Dockerfile).
11+
The project uses **CMake 3.20+ + Ninja** and **C++17**. The intended build environment is the Docker image defined in [Dockerfile.dev](Dockerfile.dev) (Ubuntu 22.04 + LLVM 16 + KLEE 3.1).
1212

13-
### Build the release (inside Docker)
13+
> The root [Dockerfile](Dockerfile) and the `make-release.sh` / `make-unit-test.sh` scripts are leftovers from the LLVM 6.0 era (hardcoded to `/llvm/release/llvm600`) and do not work with the current toolchain — use the steps below instead.
14+
15+
### Build Map2Check (inside Docker)
16+
17+
```sh
18+
git clone https://github.com/hbgit/Map2Check.git
19+
cd Map2Check
20+
docker build -t map2check-dev --no-cache -f Dockerfile.dev .
21+
docker run -it --rm -v $(pwd):/workspace map2check-dev /bin/bash
22+
```
23+
24+
Inside the container:
1425

1526
```sh
16-
docker build -t hrocha/mapdevel --no-cache -f Dockerfile .
17-
docker run --rm -v $(pwd):/home/map2check/devel_tool/mygitclone:Z --user $(id -u):$(id -g) hrocha/mapdevel /bin/bash -c "cd /home/map2check/devel_tool/mygitclone; ./make-release.sh; ./make-unit-test.sh"
27+
mkdir build && cd build
28+
cmake .. -G Ninja -DLLVM_DIR=/usr/lib/llvm-16/lib/cmake/llvm
29+
ninja && ninja install
30+
# binary at release/bin/map2check
1831
```
1932

20-
### Manual CMake build (if LLVM 6.0 is locally available)
33+
`Dockerfile.dev` already builds and installs KLEE 3.1 (to `/opt/klee`) and provides LibFuzzer via LLVM 16's compiler-rt — do **not** pass `-DSKIP_KLEE=ON` or `-DSKIP_LIB_FUZZER=ON` unless you deliberately want a build without KLEE/LibFuzzer support.
34+
35+
### Manual CMake build (if LLVM 16 is locally available, e.g. via apt.llvm.org)
2136

2237
```sh
23-
export LLVM_DIR=/llvm/release/llvm600/lib/cmake/llvm
24-
export CXX=/llvm/release/llvm600/bin/clang++
25-
export CC=/llvm/release/llvm600/bin/clang
38+
export LLVM_DIR=/usr/lib/llvm-16/lib/cmake/llvm
39+
export CXX=/usr/bin/clang++-16
40+
export CC=/usr/bin/clang-16
2641
mkdir build && cd build
2742
cmake .. -G Ninja -DLLVM_DIR=$LLVM_DIR -DSKIP_LIB_FUZZER=ON -DSKIP_KLEE=ON
2843
ninja && ninja install
@@ -58,6 +73,10 @@ Requires the `hrocha/benchexecrun` Docker image (from [utils/benchexecrun](utils
5873
./make-regression-test.sh s <xml_path> # SV-COMP set
5974
```
6075

76+
### CI
77+
78+
GitHub Actions ([.github/workflows/ci.yml](.github/workflows/ci.yml)) runs on every push/PR against LLVM 16: build + unit tests, static analysis (`clang-tidy`, `cppcheck`), and ASan/UBSan sanitizer tests. [docker-publish.yml](.github/workflows/docker-publish.yml) publishes the `Dockerfile.dev` image on push to `develop`.
79+
6180
## Code Style
6281

6382
- **C++ code**: Google C++ style — run `clang-format` with the [.clang-format](.clang-format) file.
@@ -88,7 +107,7 @@ To add a new analysis: extend `callPass()` in [caller.cpp](modules/frontend/call
88107

89108
### 2. Pass-Backend ([modules/backend/pass/](modules/backend/pass/))
90109

91-
Contains all LLVM passes that instrument the program under analysis:
110+
Contains all LLVM passes (New Pass Manager, opaque pointers) that instrument the program under analysis:
92111

93112
- `MemoryTrackPass` — instruments memory allocation/deallocation
94113
- `AssertPass` — instruments `__VERIFIER_assert` calls

0 commit comments

Comments
 (0)