Commit fc31aff1 authored by Lukáš Marek's avatar Lukáš Marek

Added jborat comiled against ASM 4.1 RC1

Adjusted jborat libs file
Fixed bad import in BinaryOperation
Run script now uses dynamic bypass by default
Fixed DiSL build
Fixed DiSL test build
Fixed dynamic bypass property
Dynamic bypass in DiSL simplified - still not tested
Added some TODOs
parent ebd394a3
asm.path=lib/asm-all-3.3.jar
asm.path=lib/asm-debug-all-4.0_RC1.jar
jborat.path=lib/jborat.jar
jborat-runtime.path=lib/jborat-runtime.jar
......@@ -6,6 +6,7 @@
<path id="buildpath">
<pathelement location="${asm.path}"/>
<pathelement location="${jborat.path}"/>
<pathelement location="${jborat-runtime.path}"/>
</path>
<target name="package" depends="compile">
......
No preview for this file type
No preview for this file type
No preview for this file type
......@@ -26,8 +26,8 @@ public class DiSL implements Instrumentation {
final String PROP_DISL_CLASSES = "disl.classes";
final String PROP_CLASSES_DELIM = ",";
final String DYNAMIC_BYPASS = ",";
final String DYNAMIC_BYPASS_TRUE = "yes";
final String PROP_DYNAMIC_BYPASS = "disl.dynbypass";
final String PROP_DYNAMIC_BYPASS_TRUE = "yes";
List<Snippet> snippets;
......@@ -48,12 +48,12 @@ public class DiSL implements Instrumentation {
"Property " + PROP_DISL_CLASSES + " is not defined");
}
String useDynamicBypassStr = System.getProperty(DYNAMIC_BYPASS);
String useDynBypassStr = System.getProperty(PROP_DYNAMIC_BYPASS);
boolean useDynamicBypass = false;
if(useDynamicBypassStr != null) {
useDynamicBypass = useDynamicBypassStr.toLowerCase()
.equals(DYNAMIC_BYPASS_TRUE);
if(useDynBypassStr != null) {
useDynamicBypass = useDynBypassStr.toLowerCase()
.equals(PROP_DYNAMIC_BYPASS_TRUE);
}
List<byte []> compiledClasses = new LinkedList<byte []>();
......
......@@ -4,7 +4,6 @@ import org.objectweb.asm.Opcodes;
import org.objectweb.asm.Type;
import org.objectweb.asm.tree.InsnList;
import org.objectweb.asm.tree.InsnNode;
import org.objectweb.asm.tree.IntInsnNode;
import org.objectweb.asm.tree.JumpInsnNode;
import org.objectweb.asm.tree.LabelNode;
import org.objectweb.asm.tree.MethodInsnNode;
......@@ -116,16 +115,9 @@ public class Snippet implements Comparable<Snippet> {
LabelNode handlerBegin = new LabelNode();
insnList.add(handlerBegin);
// high value - so we don't interfere with some other local
final int LOCAL_VAR_DYNAMIC_BYPASS = 1010101;
// store exception
insnList.add(new IntInsnNode(Opcodes.ASTORE, LOCAL_VAR_DYNAMIC_BYPASS));
// add invocation of deactivate - abnormal flow
insnList.add(mtdDeactivate);
// load exception
insnList.add(new IntInsnNode(Opcodes.ALOAD, LOCAL_VAR_DYNAMIC_BYPASS));
// throw exception
// throw exception again
insnList.add(new InsnNode(Opcodes.ATHROW));
// add handler end
......
......@@ -583,8 +583,11 @@ public class SnippetParser {
}
}
// TODO ! static analysis checking
// TODO ! analysis checking
// arguments (local variables 1, 2, ...) may be used only in method calls
// TODO ! dynamic analysis method argument checking
// values of arguments should be only constant values
return new SnippetCode(snippetCode, tryCatchBlocks, slvList,
staticAnalyses, usesDynamicAnalysis);
......
......@@ -374,9 +374,9 @@ public class Weaver {
sorter.visitEnd();
}
// TODO dynamic analysis
// TODO respect BEST_EFFORT initialization type in synthetic local variable
// TODO try-catch block weaving - bug fix
// TODO dynamic analysis - mind exceptions
public static void instrument(MethodNode methodNode,
Map<Snippet, List<MarkedRegion>> snippetMarkings,
List<SyntheticLocalVar> syntheticLocalVars,
......
<project name="disl-test" default="compile" basedir=".">
<property file="../disl.version"/>
<property file="../build.properties"/>
<property name="disl.jar.path" value="../build/disl-${disl.version}.jar"/>
<path id="buildpath">
<pathelement location="${disl.jar.path}"/>
<pathelement location="../${asm.path}"/>
<pathelement location="../${jborat.path}"/>
<pathelement location="lib/stp.jar"/>
</path>
<target name="check-disl-jar">
......
# This is a sample configuration with relative paths
# you can use full path using file:/// format
../lib/asm-all-3.3.jar
../lib/asm-all-4.0_RC1.jar
../lib/jborat.jar
../build/disl-unspec.jar
lib/udi.jar
\ No newline at end of file
......@@ -11,4 +11,4 @@ fi
DISL_CLASS="./bin/ch/usi/dag/disl/test/$1/DiSLClass.class"
TARGET_CLASS="ch.usi.dag.disl.test.$1.TargetClass"
java -javaagent:../lib/jborat-agent.jar -Dch.usi.dag.jborat.exclusionList="conf/exclusion.lst" -Dch.usi.dag.jborat.liblist="conf/lib.lst" -Dch.usi.dag.jborat.instrumentation="ch.usi.dag.disl.DiSL" -Dch.usi.dag.jborat.codemergerList="conf/codemerger.lst" -Dch.usi.dag.jborat.uninstrumented="uninstrumented" -Dch.usi.dag.jborat.instrumented="instrumented" -Xbootclasspath/p:../lib/Thread_jborat.jar:../lib/jborat-runtime.jar -Ddisl.classes=${DISL_CLASS} -cp "./bin/" ${TARGET_CLASS}
java -javaagent:../lib/jborat-agent.jar -Dch.usi.dag.jborat.exclusionList="conf/exclusion.lst" -Dch.usi.dag.jborat.liblist="conf/lib.lst" -Dch.usi.dag.jborat.instrumentation="ch.usi.dag.disl.DiSL" -Dch.usi.dag.jborat.codemergerList="conf/codemerger.lst" -Dch.usi.dag.jborat.uninstrumented="uninstrumented" -Dch.usi.dag.jborat.instrumented="instrumented" -Xbootclasspath/p:../lib/Thread_jborat.jar:../lib/jborat-runtime.jar -Ddisl.classes=${DISL_CLASS} -Ddisl.dynbypass=yes -cp "./bin/" ${TARGET_CLASS}
package ch.usi.dag.disl.test.symbolic.symbol;
import com.sun.xml.internal.ws.org.objectweb.asm.Opcodes;
import org.objectweb.asm.Opcodes;
import stp.Expr;
import stp.VC;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment