Commit 07be2d28 authored by Lubomir Bulej's avatar Lubomir Bulej
Browse files

Merge branch 'devel-pre-java9-cleanup'

parents 4df6fdb2 65050bb4
Pipeline #19877 failed with stages
in 3 minutes and 47 seconds
......@@ -9,8 +9,3 @@ Java process ends with SEGFAULT
- HOW TO FIX: Fix the instrumentation or exclude the class causing the problem
in the exclusion list (-Ddisl.exclusionList=exclusion.lst command line
option of DiSL server).
Build failure: java.lang.UnsupportedClassVersionError: ch/usi/dag/disl/utilinstr/tlvinserter/ExtendThread : Unsupported major.minor version 51.0
- CAUSE: A version 1.7.x JRE is used; this version is not yet supported
- HOW TO FIX: Use a version 1.6.x JRE instead.
......@@ -12,13 +12,10 @@ src.doc.intro=${src.doc}/intro
src.examples=examples
# Output library artifact names
disl.bypass.lib=disl-bypass.jar
disl.agent.lib.base=dislagent
shvm.dispatch.lib=dislre-dispatch.jar
shvm.agent.lib.base=dislreagent
......@@ -35,10 +32,6 @@ dist.examples=examples
dist.src=
# Java versions for specific components
target.disl.bypass=1.6
target.shvm.dispatch=1.6
# Default Java target
ant.build.javac.target=1.8
target.disl.bypass=1.8
target.shvm.dispatch=1.8
<project
name="disl" default="build" basedir="."
name="master" default="build" basedir="."
xmlns:ivy="antlib:org.apache.ivy.ant"
xmlns:ac="antlib:net.sf.ant-contrib"
>
......@@ -14,7 +14,7 @@
<property file="build.local.properties"/>
<property file="build.properties"/>
<property file="common.properties" />
<property file="common.properties"/>
<!-- ================================================================== -->
......@@ -124,6 +124,7 @@
<sequential>
<fileset dir="${basedir}" id="@{id}">
<include name="${lib.ant.dir}/*.jar"/>
<include name="${lib.cli.dir}/*.jar"/>
<include name="${lib.disl.dir}/*.jar"/>
<include name="${lib.test.dir}/*.jar"/>
</fileset>
......@@ -425,7 +426,7 @@
<ac:for list="always,never,dynamic" param="variant">
<sequential>
<mkdir dir="${build.disl.bypass}/@{variant}"/>
<javac destdir="${build.disl.bypass}/@{variant}" srcdir="${src.disl.bypass}/@{variant}" debug="true" source="${target.disl.bypass}" target="${target.disl.bypass}">
<javac destdir="${build.disl.bypass}/@{variant}" srcdir="${src.disl.bypass}/@{variant}" debug="true" source="${target.disl.bypass}" target="${target.disl.bypass}" includeantruntime="false">
<compilerarg value="-Xbootclasspath/p:${basedir}/${build.disl.thread}"/>
</javac>
</sequential>
......@@ -456,7 +457,7 @@
<!-- Shared utility code -->
<target name="compile-util" depends="-init">
<ant dir="${src.util.prefix}" target="compile" usenativebasedir="true" />
<ant dir="${src.util.prefix}" target="compile" usenativebasedir="true"/>
<!-- Register logging providers -->
<!--
......@@ -488,66 +489,82 @@
<target name="build-disl" depends="compile-disl,build-disl-bypass">
<ant dir="${src.disl-server.prefix}" target="build" />
<copy file="${src.disl-server.prefix}/${out.lib}/${disl.lib}" tofile="${out.lib}/${disl.lib}" />
<ant dir="${src.disl-server.prefix}" target="build"/>
<copy file="${src.disl-server.prefix}/${out.lib}/${disl.lib}" tofile="${out.lib}/${disl.lib}"/>
</target>
<!-- Integrated server -->
<target name="compile-server">
<ant dir="${server.prefix}" target="compile" />
<ant dir="${server.prefix}" target="compile"/>
</target>
<target name="build-server">
<ant dir="${server.prefix}" target="build" />
<copy file="${server.prefix}/${out.lib}/${server.lib}" tofile="${out.lib}/${server.lib}" />
<ant dir="${server.prefix}" target="build"/>
<copy file="${server.prefix}/${out.lib}/${server.lib}" tofile="${out.lib}/${server.lib}"/>
</target>
<!-- DiSL agent -->
<!-- Code Flags -->
<!--
The DiSL agent requires a header file containing flags for
various code generation options. This target generates the
header using "javah" after compiling DiSL.
Both agents require a header file containing flags for various code
generation options. This target triggers generation of the header file
using the "generate-codeflags" target in the DiSL subproject.
-->
<target name="-check-disl-agent-codeflags">
<target name="-check-agent-codeflags">
<property name="build.disl.agent.codeflags.path" value="${src.disl.agent}/codeflags.h"/>
<uptodate property="build.disl.agent.codeflags.uptodate" targetfile="${build.disl.agent.codeflags.path}">
<srcfiles dir="${src.disl.prefix}/src" includes="**/DiSL.java"/>
</uptodate>
</target>
<target name="-generate-disl-agent-codeflags-if-needed" unless="build.disl.agent.codeflags.uptodate" depends="-check-disl-agent-codeflags">
<antcall target="-generate-disl-agent-codeflags"/>
<property name="build.shvm.agent.codeflags.path" value="${src.shvm.agent}/disl/codeflags.h"/>
<condition property="build.agent.codeflags.uptodate">
<and>
<uptodate targetfile="${build.disl.agent.codeflags.path}" >
<srcfiles dir="${src.disl.prefix}/src" includes="**/CodeOption.java"/>
</uptodate>
<uptodate targetfile="${build.shvm.agent.codeflags.path}" >
<srcfiles dir="${src.disl.prefix}/src" includes="**/CodeOption.java"/>
</uptodate>
</and>
</condition>
</target>
<target name="-generate-disl-agent-codeflags" depends="compile-disl">
<local name="flags.class"/>
<find-class property="flags.class" dir="${src.disl.prefix}/${build.disl}" name="*CodeOption$Flag"/>
<target name="-generate-agent-codeflags-if-needed" unless="build.agent.codeflags.uptodate" depends="-check-agent-codeflags">
<ant dir="${src.disl.prefix}" target="generate-codeflags"/>
<javah outputFile="${build.disl.agent.codeflags.path}" force="yes">
<class name="${flags.class}"/>
<classpath refid="disl.classpath"/>
</javah>
<copy file="${src.disl.prefix}/${build.disl.codeflags.path}" tofile="${build.disl.agent.codeflags.path}"/>
<copy file="${src.disl.prefix}/${build.disl.codeflags.path}" tofile="${build.shvm.agent.codeflags.path}"/>
</target>
<!-- Bypass Bytecode -->
<!--
The DiSL agent requires the bytecode of several bypass
classes. This target generates the "bytecode.c" containing
the necessary bytecode.
Both agents require the bytecode of several bypass
classes. This target triggers generation of the source file
using the "generate-bytecode" target in the DiSL subproject.
-->
<target name="-check-disl-agent-bytecode">
<property name="build.disl.agent.bytecode.path" value="${src.shvm.agent}/disl/bytecode.c"/>
<uptodate property="build.disl.agent.bytecode.uptodate" targetfile="${build.disl.agent.bytecode.path}">
<srcfiles dir="${src.disl.bypass}"/>
</uptodate>
<target name="-check-agent-bytecode">
<property name="build.disl.agent.bytecode.path" value="${src.disl.agent}/bytecode.c"/>
<property name="build.shvm.agent.bytecode.path" value="${src.shvm.agent}/disl/bytecode.c"/>
<condition property="build.agent.bytecode.uptodate">
<and>
<uptodate targetfile="${build.disl.agent.bytecode.path}" >
<srcfiles dir="${src.disl.bypass}"/>
</uptodate>
<uptodate targetfile="${build.shvm.agent.bytecode.path}" >
<srcfiles dir="${src.disl.bypass}"/>
</uptodate>
</and>
</condition>
</target>
<target name="-generate-disl-agent-bytecode-if-needed" unless="build.disl.agent.bytecode.uptodate" depends="-check-disl-agent-bytecode">
<antcall target="-generate-disl-agent-bytecode"/>
<target name="-generate-agent-bytecode-if-needed" unless="build.agent.bytecode.uptodate" depends="-check-agent-bytecode">
<antcall target="-generate-agent-bytecode"/>
<copy file="${build.disl.agent.bytecode.path}" tofile="${build.shvm.agent.bytecode.path}"/>
</target>
<target name="-generate-disl-agent-bytecode" depends="compile-disl,compile-tools">
<target name="-generate-agent-bytecode" depends="compile-disl,compile-tools">
<taskdef name="bytedump" classname="ch.usi.dag.disl.tools.ByteDumpTask">
<classpath>
<pathelement location="${build.tools}"/>
......@@ -560,7 +577,7 @@
<echo file="${output.file}">/**${line.separator}</echo>
<echo file="${output.file}" append="true"> * DO NOT EDIT!${line.separator}</echo>
<echo file="${output.file}" append="true"> *${line.separator}</echo>
<echo file="${output.file}" append="true"> * This file was generated using the '-generate-disl-agent-bytecode' target.${line.separator}</echo>
<echo file="${output.file}" append="true"> * This file was generated using the '-generate-agent-bytecode' target.${line.separator}</echo>
<echo file="${output.file}" append="true"> */${line.separator}</echo>
<echo file="${output.file}" append="true">#include &lt;jvmti.h&gt;${line.separator}</echo>
......@@ -593,7 +610,7 @@
<echo file="${output.file}" append="true">&#9;.class_bytes = (unsigned char *)${line.separator}</echo>
<bytedump
srcFile="@{file.path}" destFile="${output.file}" append="true"
blockLength="16" byteFormat="\x%02x"
blockLength="16" byteFormat="\x%02x"
blockPrefix="&#9;&#9;&quot;" blockSuffix="&quot;${line.separator}" lastSuffix="&quot;,${line.separator}"
/>
<echo file="${output.file}" append="true">};${line.separator}</echo>
......@@ -602,8 +619,9 @@
</target>
<target name="prepare-disl-agent" depends="-generate-disl-agent-codeflags-if-needed,-generate-disl-agent-bytecode-if-needed"/>
<!-- DiSL agent -->
<target name="prepare-disl-agent" depends="-generate-agent-codeflags-if-needed,-generate-agent-bytecode-if-needed"/>
<target name="compile-disl-agent" depends="prepare-disl-agent">
<exec executable="make" dir="${src.disl.agent}"/>
......@@ -645,9 +663,10 @@
<ant antfile="${src.shvm.prefix}/build.xml" target="compile" usenativebasedir="true"/>
</target>
<!-- Shadow VM agent -->
<target name="compile-shvm-agent">
<target name="compile-shvm-agent" depends="-generate-agent-codeflags-if-needed,-generate-agent-bytecode-if-needed">
<exec executable="make" dir="${src.shvm.agent}">
<arg value="WHOLE=1"/>
</exec>
......@@ -655,7 +674,7 @@
<target name="build-shvm-agent" depends="compile-shvm-agent,-determine-lib-names">
<copy file="${src.shvm.agent}/${shvm.agent.lib}" todir="${out.lib}"/>
<copy file="${src.shvm.agent}/${disl.agent.os}-${disl.agent.arch}/${shvm.agent.lib}" todir="${out.lib}"/>
</target>
......@@ -664,7 +683,7 @@
<path id="test.classpath">
<path refid="util.classpath"/>
<path refid="disl.classpath"/>
<path refid="server.classpath" />
<path refid="server.classpath"/>
<path refid="shvm.classpath"/>
<path refid="junit.classpath"/>
<path refid="asm.classpath"/>
......@@ -826,11 +845,11 @@
<classpath>
<path refid="asm.classpath"/>
<path refid="junit.classpath"/>
<path refid="server.classpath" />
<path refid="server.classpath"/>
<pathelement location="${build.test}"/>
<pathelement location="${src.util.prefix}/${build.util}" />
<pathelement location="${src.util.prefix}/${build.util}"/>
<pathelement location="${src.disl.prefix}/${build.disl}"/>
<pathelement location="${src.shvm.prefix}/${build.shvm}" />
<pathelement location="${src.shvm.prefix}/${build.shvm}"/>
</classpath>
<!-- pass properties starting with "disl.", "dislserver.", and "dislreserver." to the tests -->
......@@ -926,7 +945,7 @@
>
<sourcepath>
<dirset dir="${src.disl.prefix}/src">
<include name="src-*" />
<include name="src-*"/>
</dirset>
</sourcepath>
......@@ -963,7 +982,7 @@
<copy todir="${out.lib}" flatten="true">
<path refid="asm.classpath"/>
<path refid="protobuf.classpath"/>
<path refid="cli.classpath" />
<path refid="cli.classpath"/>
</copy>
</target>
......@@ -1041,9 +1060,10 @@
<!-- Summary targets -->
<target name="properties" depends="-determine-lib-names">
<target name="properties" depends="-determine-lib-names" description="Displays the values of all build properties.">
<echoproperties/>
</target>
</target>
<target name="compile" depends="compile-disl,compile-shvm,compile-server,compile-shvm-agent" description="Compiles DiSL, Shadow VM, and the JVM agents for both."/>
......@@ -1064,11 +1084,10 @@
<target name="clean" description="Removes all files produced during the build.">
<ant dir="${src.shvm.prefix}" target="clean"/>
<ant dir="${src.disl.prefix}" target="clean"/>
<ant dir="${server.prefix}" target="clean"/>
<ant dir="${src.util.prefix}" target="clean"/>
<ant dir="${src.shvm.prefix}" target="clean"/>
<ant dir="${src.disl.prefix}" target="clean"/>
<ant dir="${server.prefix}" target="clean"/>
<ant dir="${src.util.prefix}" target="clean"/>
<exec executable="make" dir="${src.disl.agent}">
<arg value="cleanall"/>
......@@ -1084,10 +1103,10 @@
<target name="clean-deps" description="Removes all downloaded dependency artifacts.">
<delete dir="${lib.ant.dir}"/>
<delete dir="${lib.cli.dir}"/>
<delete dir="${lib.disl.dir}"/>
<delete dir="${lib.test.dir}"/>
<delete dir="${lib.devel.dir}"/>
<delete dir="${lib.cli.dir}"/>
</target>
</project>
......@@ -11,8 +11,8 @@ lib.cli.dir=${lib.dir}/cli
build.artifacts.list = ${lib.dir}/artifacts.lst
# Build system libraries
build.ivy.url = http://central.maven.org/maven2/org/apache/ivy/ivy/${ivy.rev}/ivy-${ivy.rev}.jar
build.ivy.path = ${lib.ant.dir}/ivy.jar
build.ivy.url = https://repo.maven.apache.org/maven2/org/apache/ivy/ivy/${ivy.rev}/ivy-${ivy.rev}.jar
build.ivy.path = ${lib.ant.dir}/ivy-${ivy.rev}.jar
build.ivy.file = dependencies.xml
......@@ -50,6 +50,8 @@ build.disl-server=${build.dir}/disl-server
build.disl.thread=${build.disl}-thread
build.disl.bypass=${build.disl}-bypass
build.disl.codeflags.path=${build.dir}/include/codeflags.h
build.shvm=${build.dir}/${src.shvm.prefix}
build.shvm-server=${build.dir}/shvm-server
build.shvm.dispatch=${build.shvm}-dispatch
......@@ -66,3 +68,6 @@ release.bin.tar=${release}/disl-${disl.version}-bin.tar.bz2
release.src.zip=${release}/disl-${disl.version}-src.zip
release.src.tar=${release}/disl-${disl.version}-src.tar.bz2
# Default Java source/target
ant.build.javac.source=1.8
ant.build.javac.target=1.8
ivy.rev=2.4.0
ivy.rev=2.5.0
ant-contrib.rev=1.0b3
ant-contrib.org=ant-contrib
......@@ -6,15 +6,15 @@ ant-contrib.org=ant-contrib
junit.rev=4.12
junit.org=junit
asm.rev=7.2
asm.rev=9.2
asm.org=org.ow2.asm
log4j.rev=1.2.17
log4j.org=log4j
protobuf.rev=3.0.1
protobuf.rev=3.14.0
protobuf.org=com.google.protobuf
protobuf.lib=protobuf-lite
protobuf.lib=protobuf-javalite
jcommander.rev=1.78
jcommander.org=com.beust
......
......@@ -8,28 +8,28 @@
<info organisation="ch.usi.dag" module="disl"/>
<configurations>
<conf name="ant" description="Libraries needed by Ant" />
<conf name="disl" description="Libraries needed by DiSL" />
<conf name="test" description="Libraries needed for testing" />
<conf name="devel" description="Files useful for development" />
<conf name="cli" description="Libraries needed for command line interface" />
<conf name="ant" description="Libraries needed by Ant"/>
<conf name="disl" description="Libraries needed by DiSL"/>
<conf name="test" description="Libraries needed for testing"/>
<conf name="devel" description="Files useful for development"/>
<conf name="cli" description="Libraries needed for command line interface"/>
</configurations>
<dependencies>
<!-- Build system libraries: no need for sources/javadoc -->
<dependency org="${ant-contrib.org}" name="ant-contrib" rev="${ant-contrib.rev}" conf="ant->master" />
<dependency org="${ant-contrib.org}" name="ant-contrib" rev="${ant-contrib.rev}" conf="ant->master"/>
<!-- Test libraries -->
<dependency org="${junit.org}" name="junit" rev="${junit.rev}" conf="test->default;devel->sources,javadoc" />
<dependency org="${junit.org}" name="junit" rev="${junit.rev}" conf="test->default;devel->sources,javadoc"/>
<!-- DiSL libraries -->
<dependency org="${asm.org}" name="asm" rev="${asm.rev}" conf="disl->default;devel->sources,javadoc" />
<dependency org="${asm.org}" name="asm-tree" rev="${asm.rev}" conf="disl->default;devel->sources,javadoc" />
<dependency org="${asm.org}" name="asm-analysis" rev="${asm.rev}" conf="disl->default;devel->sources,javadoc" />
<dependency org="${asm.org}" name="asm-util" rev="${asm.rev}" conf="disl->default;devel->sources,javadoc" />
<dependency org="${asm.org}" name="asm-commons" rev="${asm.rev}" conf="disl->default;devel->sources,javadoc" />
<dependency org="${log4j.org}" name="log4j" rev="${log4j.rev}" conf="disl->default;devel->sources,javadoc" />
<dependency org="${protobuf.org}" name="${protobuf.lib}" rev="${protobuf.rev}" conf="disl->default;devel->sources,javadoc" />
<dependency org="${asm.org}" name="asm" rev="${asm.rev}" conf="disl->default;devel->sources,javadoc"/>
<dependency org="${asm.org}" name="asm-tree" rev="${asm.rev}" conf="disl->default;devel->sources,javadoc"/>
<dependency org="${asm.org}" name="asm-analysis" rev="${asm.rev}" conf="disl->default;devel->sources,javadoc"/>
<dependency org="${asm.org}" name="asm-util" rev="${asm.rev}" conf="disl->default;devel->sources,javadoc"/>
<dependency org="${asm.org}" name="asm-commons" rev="${asm.rev}" conf="disl->default;devel->sources,javadoc"/>
<dependency org="${log4j.org}" name="log4j" rev="${log4j.rev}" conf="disl->default;devel->sources,javadoc"/>
<dependency org="${protobuf.org}" name="${protobuf.lib}" rev="${protobuf.rev}" conf="disl->default;devel->sources,javadoc"/>
<!-- UI deps -->
<dependency org="${jcommander.org}" name="${jcommander.lib}" rev="${jcommander.rev}" conf="cli->default;devel->sources"/>
......
<project name="disl-server" default="build" basedir=".">
<!--
Import required property files.
-->
<property file="../common.properties"/>
<property file="build.properties" />
<property file="../disl.version.properties" />
<!--
Initialize the build directory
-->
<target name="init">
<mkdir dir="${build.disl-server}" />
</target>
<!--
Dependency class paths
-->
<path id="asm.classpath">
<fileset dir="../${lib.disl.dir}" includes="asm*.jar" id="asm.fileset"/>
</path>
<path id="util.classpath">
<pathelement location="../${src.util.prefix}/${build.util}"/>
</path>
<path id="protobuf.classpath">
<fileset dir="../${lib.disl.dir}" includes="protobuf*.jar"/>
</path>
<!--
Refer to the parent targets
-->
<target name="compile-util">
<ant antfile="../build.xml" target="compile-util" usenativebasedir="true" />
</target>
<target name="compile-disl">
<ant antfile="../build.xml" target="compile-disl" usenativebasedir="true" />
</target>
<target name="build-disl-bypass">
<ant antfile="../build.xml" target="build-disl-bypass" usenativebasedir="true" />
</target>
<!-- DiSL Server -->
<target name="compile" depends="compile-util,init, compile-disl">
<javac destdir="${build.disl-server}" debug="true" srcdir="src/">
<classpath>
<path path="../${src.disl.prefix}/${build.disl}" />
<path refid="util.classpath"/>
<path refid="protobuf.classpath"/>
</classpath>
</javac>
</target>
<union id="disl.bypass.files">
<fileset dir="../${build.disl.bypass}/always" includes="**/BypassCheck.class"/>
<fileset dir="../${build.disl.bypass}/dynamic" includes="**/DynamicBypass.class"/>
</union>
<!-- Get ASM libs from ASM class path. -->
<pathconvert pathsep=" " property="asm.libs" refid="asm.classpath">
<mapper type="flatten"/>
</pathconvert>
<!-- Get ProtoBuf Java libs from ProtoBuf class path. -->
<pathconvert pathsep=" " property="protobuf.libs" refid="protobuf.classpath">
<mapper type="flatten"/>
</pathconvert>
<target name="build" depends="compile, build-disl-bypass">
<jar destfile="${out.lib}/${disl.lib}">
<manifest>
<attribute name="Class-Path" value="${asm.libs} ${protobuf.libs}"/>
<attribute name="Main-Class" value="ch.usi.dag.dislserver.DiSLServer"/>
<attribute name="DiSL-Version" value="${disl.version}"/>
</manifest>
<service type="javax.annotation.processing.Processor" provider="ch.usi.dag.disl.DislClassFinder"/>
<fileset dir="${build.disl-server}" />
<fileset dir="../${src.util.prefix}/${build.util}"/>
<fileset dir="../${src.disl.prefix}/${build.disl}"/>
<resources refid="disl.bypass.files"/>
</jar>
</target>
<!--
Clean the build directory
-->
<target name="clean">
<delete dir="output" />
</target>
<property file="../common.properties"/>
<property file="../disl.version.properties"/>
<property file="build.properties"/>
<!-- Dependency class paths. -->
<path id="asm.classpath">
<fileset dir="../${lib.disl.dir}" includes="asm*.jar" id="asm.fileset"/>
</path>
<path id="util.classpath">
<pathelement location="../${src.util.prefix}/${build.util}"/>
</path>
<path id="protobuf.classpath">
<fileset dir="../${lib.disl.dir}" includes="protobuf*.jar"/>
</path>
<!-- Targets in the parent project. -->
<target name="-parent-compile-util">
<ant antfile="../build.xml" target="compile-util" usenativebasedir="true"/>
</target>
<target name="-parent-compile-disl">
<ant antfile="../build.xml" target="compile-disl" usenativebasedir="true"/>
</target>
<target name="-parent-compile-disl-bypass">
<ant antfile="../build.xml" target="compile-disl-bypass" usenativebasedir="true"/>
</target>
<!-- DiSL Server -->
<target name="compile" depends="-parent-compile-util,-parent-compile-disl">
<mkdir dir="${build.disl-server}"/>
<javac destdir="${build.disl-server}" debug="true" srcdir="src/" includeantruntime="false">
<classpath>
<path path="../${src.disl.prefix}/${build.disl}"/>
<path refid="util.classpath"/>
<path refid="protobuf.classpath"/>
</classpath>
</javac>
</target>
<target name="build" depends="compile,-parent-compile-disl-bypass">
<!-- Convert class paths to lists of jars for use with the Class-Path attribute. -->
<pathconvert pathsep=" " property="asm.libs" refid="asm.classpath"><mapper type="flatten"/></pathconvert>
<pathconvert pathsep=" " property="protobuf.libs" refid="protobuf.classpath"><mapper type="flatten"/></pathconvert>
<jar destfile="${out.lib}/${disl.lib}">
<manifest>
<attribute name="DiSL-Version" value="${disl.version}"/>
<attribute name="Main-Class" value="ch.usi.dag.dislserver.DiSLServer"/>
<attribute name="Class-Path" value="${asm.libs} ${protobuf.libs}"/>
</manifest>
<service type="javax.annotation.processing.Processor" provider="ch.usi.dag.disl.DislClassFinder"/>
<fileset dir="${build.disl-server}"/>
<!-- DiSL library and utility classes. -->
<fileset dir="../${src.disl.prefix}/${build.disl}"/>
<fileset dir="../${src.util.prefix}/${build.util}"/>
<!-- DiSL bypass classes. -->
<fileset dir="../${build.disl.bypass}/always" includes="**/BypassCheck.class"/>
<fileset dir="../${build.disl.bypass}/dynamic" includes="**/DynamicBypass.class"/>
</jar>
</target>
<target name="clean" description="Remove build outputs">
<delete dir="${out.dir}"/>
</target>
</project>
......@@ -8,7 +8,6 @@ import com.google.protobuf.CodedInputStream;
import com.google.protobuf.CodedOutputStream;
import ch.usi.dag.disl.DiSLException;
import ch.usi.dag.dislre.protocol.DiSL.InstrumentClassResponse;
import ch.usi.dag.dislre.protocol.DiSL.InstrumentationAcceptConfirmation;
import ch.usi.dag.dislre.protocol.DiSL.InstrumentationDelivery;
......@@ -181,19 +180,16 @@ final class ConnectionHandler implements Runnable {
}
case INSTRUMENTATION_DELIVERY: {
final Session session = __server.getSession (request.getRequestId ());
final InstrumentationDelivery instrumentation = request.getInstrumentationDelivery ();
int sourceOffset = 0;
for (int i = 0; i < instrumentation.getSizesCount (); ++i) {
final int jarSize = instrumentation.getSizes (i);
final Session session = __server.getSession (request.getSessionId ());
final InstrumentationDelivery delivery = request.getInstrumentationDelivery ();
// Use byte buffer to track the source offset.
final ByteBuffer buffer = delivery.getInstrumentation ().asReadOnlyByteBuffer ();
delivery.getSizesList ().stream ().forEach (jarSize -> {
final byte [] jarBytes = new byte [jarSize];
instrumentation.getInstrumentation ().copyTo (jarBytes, sourceOffset, 0, jarSize);
buffer.get (jarBytes);