Open docker terminal and move to desired working directory
$ cd "desired/path/..."
Build an image from the dockerfile and run the container with a mounted volume on current folder
$ docker build -t bit github.com/arturesteves/bit-bootstrap && docker run --privileged --rm -it -v "$(pwd):/usr/src/my-app" bit bash
Just to run the container
$ docker run --privileged --rm -it -v "$(pwd):/usr/src/my-app" bit bash
Move to the directory that contain some implementations of bit tools
$ cd /tmp/cnv/BIT/samples
Run a bit tool, for example the ICount, and output the result to a directory.
$ java ICount /tmp/cnv/BIT/examples /tmp/cnv/BIT/examples/output
Attention that each bit tool receives a different arguments, but they tend to follow as specified above:
java [Bit tool class] [class or directory to analyze or instrument] [directory to place intrumented classes]
Move to the directory where the instrumented code is
$ cd /tmp/cnv/BIT/examples/output
Execute instrumented code of class Hello
$ java Hello
Get the signature of a class and its methods and the attibutes.
$ javap Hello
Get the java byte code of a class and output the result to a file.
$ javap -c Hello > helloByteCode.txt
- Create a directory dedicated to the tool
- Build a docker image with BIT on the directory
Follow instructions from section Instructions to setup the environment - Create the java class(es)
- Compile java class
- Execute instrumentation code (tool created, with the java command)
- Execute the output of the instrumentation code (with the java command)
- Create a directory dedicated to the tool
- Copy the BIT directory (which contains the directories highBIT and lowBIT) to the directory created
- Create the java class(es)
- Install Java version 7 (Java 1.7) required
- Setup java and javac classpaths to Java version 7
- Disable stackmaps for easier instrumentation
$ export _JAVA_OPTIONS="-XX:-UseSplitVerifier "$_JAVA_OPTIONS
- Compile java class
- Execute instrumentation code (tool created, with the java command)
- Execute the output of the instrumentation code (with the java command)