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

Skeleton for remote dispatch object

parent 9939566f
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="src-re-disp"/>
<classpathentry kind="src" path="src-re-server"/>
<classpathentry kind="src" path="src-agent-java"/>
<classpathentry kind="src" path="src-test"/>
......
......@@ -5,7 +5,8 @@ src.disl=src
src.dynbypass=src-dynbypass
src.dynbypass.act=src-dynbypass-act
src.agent.java=src-agent-java
src.dislre=src-re-server
src.dislre.server=src-re-server
src.dislre.dispatch=src-re-disp
src.test=src-test
bin=bin
......
......@@ -47,8 +47,14 @@
</javac>
</target>
<target name="compile-dislre">
<javac srcdir="${src.dislre}" destdir="${bin}" debug="true" includeAntRuntime="false">
<target name="compile-dislre-server">
<javac srcdir="${src.dislre.server}" destdir="${bin}" debug="true" includeAntRuntime="false">
<classpath refid="buildpath" />
</javac>
</target>
<target name="compile-dislre-dispatch">
<javac srcdir="${src.dislre.dispatch}" destdir="${bin}" debug="true" includeAntRuntime="false">
<classpath refid="buildpath" />
</javac>
</target>
......@@ -59,27 +65,16 @@
</javac>
</target>
<target name="compile" depends="compile-disl,compile-agent-java,compile-test,compile-dislre" />
<target name="compile" depends="compile-disl,compile-agent-java,compile-test,compile-dislre-server,compile-dislre-dispatch" />
<target name="package-dislserver" depends="compile-disl">
<jar basedir="${bin}" destfile="${build}/dislserver-${disl.version}.jar"
includes="ch/usi/dag/disl/**,ch/usi/dag/dislserver/**"
excludes="ch/usi/dag/disl/test/**,ch/usi/dag/disl/testtools/**">
<manifest>
<attribute name="Class-Path" value="${asm.lib} ${instr.jar.name}" />
<attribute name="Main-Class" value="ch.usi.dag.dislserver.DiSLServer" />
</manifest>
</jar>
</target>
<target name="package-dislreserver" depends="compile-dislre">
<jar basedir="${bin}" destfile="${build}/dislreserver-${disl.version}.jar"
includes="ch/usi/dag/dislreserver/**">
<manifest>
<attribute name="Class-Path" value="${asm.lib} ${instr.jar.name}" />
<attribute name="Main-Class" value="ch.usi.dag.dislreserver.DiSLREServer" />
<attribute name="Main-Class" value="ch.usi.dag.dislserver.DiSLServer" />
</manifest>
</jar>
</target>
......@@ -96,10 +91,10 @@
<!-- rename after bootstrap class -->
<move file="${build.afterbootstrap}/ch/usi/dag/disl/dynamicbypass/DynamicBypassCheck.class"
tofile="${build.afterbootstrap}/DynamicBypassCheck-AfterBootstrap.class" />
<jar basedir="${bin}" destfile="${build}/dislagent-${disl.version}.jar"
includes="ch/usi/dag/dislagent/**,ch/usi/dag/disl/dynamicbypass/**">
<manifest>
<attribute name="Class-Path" value="${instr.jar.name}" />
<attribute name="Premain-Class" value="ch.usi.dag.dislagent.DiSLAgent" />
......@@ -114,7 +109,24 @@
<delete dir="${build.afterbootstrap}" />
</target>
<target name="package" depends="package-dislserver,package-dislagent-java,package-dislreserver" />
<target name="package-dislre-server" depends="compile-dislre-server">
<jar basedir="${bin}" destfile="${build}/dislre-server-${disl.version}.jar"
includes="ch/usi/dag/dislreserver/**">
<manifest>
<attribute name="Class-Path" value="${asm.lib} ${instr.jar.name}" />
<attribute name="Main-Class" value="ch.usi.dag.dislreserver.DiSLREServer" />
</manifest>
</jar>
</target>
<target name="package-dislre-dispatch" depends="compile-dislre-dispatch">
<jar basedir="${bin}" destfile="${build}/dislre-dispatch-${disl.version}.jar"
includes="ch/usi/dag/dislre/**">
</jar>
</target>
<target name="package" depends="package-dislserver,package-dislagent-java,package-dislre-server,package-dislre-dispatch" />
<target name="eclipse-agent" description="creates simple agent jar file for eclipse">
<mkdir dir="build" />
......@@ -127,7 +139,7 @@
<target name="eclipse-dynamicbypass" depends="compile-dynamicbypass"
description="creates support library for DiSL development under eclipse">
<jar basedir="${bin}" destfile="${build}/eclipse-dynamicbypass.jar"
includes="ch/usi/dag/disl/dynamicbypass/" />
</target>
......
......@@ -15,6 +15,6 @@ fi
java -agentpath:${C_AGENT} \
-agentpath:${RE_AGENT} \
-javaagent:build/dislagent-unspec.jar \
-Xbootclasspath/a:build/dislagent-unspec.jar:build/dislinstr.jar \
-Xbootclasspath/a:build/dislagent-unspec.jar:build/dislinstr.jar:build/dislre-dispatch-unspec.jar \
-cp bin/ \
$*
......@@ -4,9 +4,8 @@
# -Ddebug=true \
# -Ddislserver.port="portNum" \
java -Ddebug=true \
$* \
-jar build/dislreserver-unspec.jar \
java $* \
-jar build/dislre-server-unspec.jar \
&
echo $! > re_${SERVER_FILE}
# rename this file to Makefile.local to take effect
# if variable is not defined autodetection or default is used
JAVA_HOME = /etc/alternatives/java_sdk/
......@@ -487,3 +487,13 @@ JNIEXPORT jint JNICALL Agent_OnLoad(JavaVM *jvm, char *options, void *reserved)
return 0;
}
// ******************* REDispatch methods *******************
JNIEXPORT void JNICALL Java_ch_usi_dag_dislre_REDispatch_analyse
(JNIEnv * jni_env, jclass this_class, jint objID, jint methodID, jobjectArray args) {
// TODO create send method for each basic type
printf("I'm here\n");
}
......@@ -13,5 +13,21 @@ JNIEXPORT jint JNICALL Agent_OnLoad(JavaVM *jvm, char *options, void *reserved);
}
#endif
// ******************* REDispatch methods *******************
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: ch_usi_dag_dislre_REDispatch
* Method: analyse
* Signature: (II[Ljava/lang/Object;)V
*/
JNIEXPORT void JNICALL Java_ch_usi_dag_dislre_REDispatch_analyse
(JNIEnv *, jclass, jint, jint, jobjectArray);
#ifdef __cplusplus
}
#endif
#endif /* _DISLAGENT_H */
package ch.usi.dag.dislre;
public class REDispatch {
// TODO remove
public static native void analyse(int analysisID, int methodID, Object ... args);
// TODO uncomment
/*
public static native void analyse(int analysisID, int methodID);
// TODO all basic types in jni
public static native void sendInt(int intToSend);
*/
}
package ch.usi.dag.disl.test.dispatch;
import ch.usi.dag.disl.annotation.After;
import ch.usi.dag.disl.marker.BodyMarker;
import ch.usi.dag.dislre.REDispatch;
public class DiSLClass {
@After(marker = BodyMarker.class, scope = "TargetClass.empty", order=0)
public static void emptypostcondition() {
REDispatch.analyse(1, 1);
}
}
Manifest-Version: 1.0
DiSL-Classes: ch.usi.dag.disl.test.dispatch.DiSLClass
\ No newline at end of file
package ch.usi.dag.disl.test.dispatch;
public class TargetClass {
public void empty() {
}
public static void main(String[] args) {
TargetClass t = new TargetClass();
t.empty();
}
}
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