Manual for CCMOP

Here we give a brief manual for using CCMOP. There are three parts. The first part is the manual for installing and running the docker image of CCMOP. The second part is the usage of the transparent compilation script wac. The final part is a brief account of the syntax of the property.

1.Install and Run the Docker Image

(1).Install and start docker

We suppose you have installed the docker environment; otherwise, please go to this link for help.

(2).Download CCMOP docker image

The following command will download the image named ccmop/ccmop.

docker pull ccmop/ccmop

If the image downloading succeeds, you can use the following command to check.

docker images

You should see that an image named ccmop/ccmop exists.

(3).Run the docker image

You can run the docker image and have a try. The following command will create a container for ccmop/ccmop and open the terminal.

docker run -it ccmop/ccmop /bin/bash

Get in the CCMOP/examples/CXX/UnSafeIterator directory and compile an example program.

cd CCMOP/examples/CXX/UnSafeIterator
wac -cxx -mop UnSafeIterator.mop test.cpp -o a
./a

If the commands above succeed, you can see the results in bash.

NOTE: If you use CCMOP not in our supplied docker image, you should run the following commands to initialize the environmental variables, and the clang version should be 15.02 with Release type.

2.Usage of wac

We show the usage of wac as follows.

(1). Common arguments

The following command will list all the arguments.

wac  -h

The argument -print will dump the instrumented file.

wac  -print

(2). Compile model

There are two models of WAC, one for project compilation and another for single-file compilation.

Note: if you need to run CMake for the C program, you may need to add the following argument

-DCMAKE_C_COMPILER_ID=Clang

Note: if you need to monitor a program that only generates a static library, you may need to explicitly specify AR as ${war}.

3.Property Syntax

The syntax of the property is designed based on JavaMOP’s MOP syntax. We show the property syntax (not AOP syntax) with a file extension as .mop. The symbol [] represents an optional occurrence (either once or none), while the symbol {} represents a repeating occurrence (either once or multiple times).

(1). MOP syntax

The MOP syntax describes the top syntax of the property.

overview-syntax

(2).Instance syntax

The Instance syntax describes the syntax involved in MOP syntax.

instance-syntax

By the way, when derefPointer encounters situations where code instrumentation may alter the program semantics, we ignore such instrumentations.

(3).AOP syntax

The following syntax describes the core feature of our AOP language designed for C++ programs.

knitC-syntax

Contacts

Please feel free to contact us if you have any questions about CCMOP.