MDG Usage

How to use the MDG

Given a program under analysis (in the format of bytecode), the following step will first create the MDG for that program and then computes forward dependencies either for a specified query (method for which the dependencies are to be queried) or, if not specified, for all methods in the program as queries. We use a script encompassing the details to demonstrate the usage.

As shown in the following example, the class path for JVM and Soot are given by "MAINCP" and "SOOTCP", respectively. To run this step on command line under Windows environments, the shell script below can be converted into batch script accordingly. When running it in IDEs such as Eclipse, a Run/Debug configuration can be created by picking class paths as exemplified in the script too with corresponding parameters specified.
The primary parameters are explained as follows.

ver=$1
seed=$2
ROOT=/home/hcai/
subjectloc=/home/hcai/SVNRepos/star-lab/trunk/Subjects/Schedule1/

MAINCP=".:/etc/alternatives/java_sdk/jre/lib/rt.jar:$ROOT/tools/polyglot-1.3.5/lib/polyglot.jar:$ROOT/tools/soot-2.3.0/lib/sootclasses-2.3.0.jar:$ROOT/tools/jasmin-2.3.0/lib/jasminclasses-2.3.0.jar:$ROOT/workspace/DUAForensics/bin:$ROOT/workspace/LocalsBox/bin:$ROOT/workspace/InstrReporters/bin:$ROOT/workspace/mcia/bin:$ROOT/tools/java_cup.jar"

mkdir -p out-MDG
#$ROOT/software/j2re1.4.2_18/lib/rt.jar
SOOTCP=".:$ROOT/software/j2re1.4.2_18/lib/rt.jar:$ROOT/workspace/DUAForensics/bin:$ROOT/workspace/LocalsBox/bin:$ROOT/workspace/InstrReporters/bin:$ROOT/workspace/mcia/bin":$subjectloc/bin/${ver}${seed}:$subjectloc/lib

OUTDIR=$subjectloc/MDGAnalyzed-$ver$seed
mkdir -p $OUTDIR

java -Xmx4600m -ea -cp ${MAINCP} MDG.MdgAnalysis \
	-w -cp ${SOOTCP} \
	-p cg verbose:true,implicit-entry:false -p cg.spark verbose:true,on-fly-cg:true,rta:true \
	-f n -d "$OUTDIR" -brinstr:off -duainstr:off \
	-allowphantom \
	-slicectxinsens \
	-intraCD \
	-queryAll \
	-exInterCD \
	-interCD \
	-main-class ScheduleClass -entry:ScheduleClass \
	-process-dir $subjectloc/bin/${ver}${seed}  \
	1>out-MDG/log-${ver}${seed}.out 2>out-MDG/log-${ver}${seed}.err


Generated on 4 Apr 2015 by  doxygen 1.6.1