Skip to content

Commit

Permalink
BTRACE-122: Changes in instrumentors for BTRACE-117 and BTRACE-119 ca…
Browse files Browse the repository at this point in the history
…used regressions
  • Loading branch information
jbachorik committed Jul 28, 2014
1 parent 042aa9e commit 7c4dc30
Show file tree
Hide file tree
Showing 32 changed files with 781 additions and 220 deletions.
5 changes: 5 additions & 0 deletions nbproject/genfiles.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/jdk.xml.data.CRC32=f99b410e
nbproject/jdk.xml.script.CRC32=5342cb35
nbproject/jdk.xml.stylesheet.CRC32=[email protected]
4 changes: 2 additions & 2 deletions nbproject/ide-file-targets.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<fail unless="run.class">Must set property 'run.class'</fail>
<path id="cp">
<pathelement
path="test-lib/junit-4.6.jar;test-lib/asm-${asm.version}.jar;test-lib/asm-util-${asm.version}.jar;test-lib/ant-junit.jar;"/>
path="test-lib/junit-4.6.jar;test-lib/asm-${asm.version}.jar;test-lib/asm-all-${asm.version}.jar;test-lib/ant-junit.jar;"/>
<pathelement path="build/test"/>
<pathelement path="build/classes"/>
</path>
Expand All @@ -62,7 +62,7 @@ value="-Xrunjdwp:transport=dt_socket,address=${jpda.address},suspend=y"/>-->
<fail unless="debug.class">Must set property 'run.class'</fail>
<path id="cp">
<pathelement
path="test-lib/junit-4.6.jar;test-lib/asm-${asm.version}.jar;test-lib/asm-util-${asm.version}.jar;test-lib/ant-junit.jar;"/>
path="test-lib/junit-4.6.jar;test-lib/asm-${asm.version}.jar;test-lib/asm-all-${asm.version}.jar;test-lib/ant-junit.jar;"/>
<pathelement path="build/test"/>
<pathelement path="build/classes"/>
</path>
Expand Down
157 changes: 157 additions & 0 deletions nbproject/jdk.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
<?xml version="1.0" encoding="UTF-8"?><project name="jdk" basedir=".">


<description>
Permits selection of a JDK to use when building and running project.
See: http://www.netbeans.org/issues/show_bug.cgi?id=64160
</description>

<target name="-jdk-pre-preinit">
<condition property="nbjdk.active-or-nbjdk.home">
<or>
<and>
<isset property="nbjdk.active"/>
<not>
<equals arg1="${nbjdk.active}" arg2="default_platform"/>
</not>
</and>
<and>
<isset property="nbjdk.home"/>
<not>
<isset property="nbjdk.home.defaulted"/>
</not>
</and>
</or>
</condition>
</target>

<target xmlns:common="http://java.netbeans.org/freeform/jdk.xml" name="-jdk-preinit" depends="-jdk-pre-preinit" if="nbjdk.active-or-nbjdk.home">
<macrodef name="property" uri="http://java.netbeans.org/freeform/jdk.xml">
<attribute name="name"/>
<attribute name="value"/>
<sequential>
<property name="@{name}" value="${@{value}}"/>
</sequential>
</macrodef>
<common:property name="nbjdk.home" value="platforms.${nbjdk.active}.home"/>
<common:property name="nbjdk.javac.tmp" value="platforms.${nbjdk.active}.javac"/>
<condition property=".exe" value=".exe">
<os family="windows"/>
</condition>
<property name=".exe" value=""/>
<condition property="nbjdk.javac" value="${nbjdk.home}/bin/javac${.exe}">
<equals arg1="${nbjdk.javac.tmp}" arg2="$${platforms.${nbjdk.active}.javac}"/>
</condition>
<property name="nbjdk.javac" value="${nbjdk.javac.tmp}"/>
<common:property name="nbjdk.java.tmp" value="platforms.${nbjdk.active}.java"/>
<condition property="nbjdk.java" value="${nbjdk.home}/bin/java${.exe}">
<equals arg1="${nbjdk.java.tmp}" arg2="$${platforms.${nbjdk.active}.java}"/>
</condition>
<property name="nbjdk.java" value="${nbjdk.java.tmp}"/>
<common:property name="nbjdk.javadoc.tmp" value="platforms.${nbjdk.active}.javadoc"/>
<condition property="nbjdk.javadoc" value="${nbjdk.home}/bin/javadoc${.exe}">
<equals arg1="${nbjdk.javadoc.tmp}" arg2="$${platforms.${nbjdk.active}.javadoc}"/>
</condition>
<property name="nbjdk.javadoc" value="${nbjdk.javadoc.tmp}"/>
<common:property name="nbjdk.bootclasspath.tmp" value="platforms.${nbjdk.active}.bootclasspath"/>
<condition property="nbjdk.bootclasspath" value="${nbjdk.home}/jre/lib/rt.jar">
<equals arg1="${nbjdk.bootclasspath.tmp}" arg2="$${platforms.${nbjdk.active}.bootclasspath}"/>
</condition>
<property name="nbjdk.bootclasspath" value="${nbjdk.bootclasspath.tmp}"/>
<condition property="nbjdk.valid">
<and>
<available file="${nbjdk.home}" type="dir"/>
<available file="${nbjdk.javac}" type="file"/>
<available file="${nbjdk.java}" type="file"/>
<available file="${nbjdk.javadoc}" type="file"/>

</and>
</condition>
<echo level="verbose">nbjdk.active=${nbjdk.active} nbjdk.home=${nbjdk.home} nbjdk.java=${nbjdk.java} nbjdk.javac=${nbjdk.javac} nbjdk.javadoc=${nbjdk.javadoc} nbjdk.bootclasspath=${nbjdk.bootclasspath} nbjdk.valid=${nbjdk.valid} have-jdk-1.4=${have-jdk-1.4} have-jdk-1.5=${have-jdk-1.5}</echo>
</target>

<target name="-jdk-warn" depends="-jdk-preinit" if="nbjdk.active-or-nbjdk.home" unless="nbjdk.valid">
<property name="jdkhome.presumed" location="${java.home}/.."/>
<echo level="warning">Warning: nbjdk.active=${nbjdk.active} or nbjdk.home=${nbjdk.home} is an invalid Java platform; ignoring and using ${jdkhome.presumed}</echo>
</target>

<target name="-jdk-presetdef-basic" depends="-jdk-preinit" if="nbjdk.valid" unless="nbjdk.presetdef.basic.done">


<macrodef name="javac-presetdef">
<attribute name="javacval"/>
<sequential>
<presetdef name="javac">
<javac fork="yes" executable="@{javacval}"/>
</presetdef>
</sequential>
</macrodef>
<javac-presetdef javacval="${nbjdk.javac}"/>
<macrodef name="java-presetdef">
<attribute name="javaval"/>
<sequential>
<presetdef name="java">
<java fork="yes" jvm="@{javaval}"/>
</presetdef>
</sequential>
</macrodef>
<java-presetdef javaval="${nbjdk.java}"/>
<macrodef name="javadoc-presetdef">
<attribute name="javadocval"/>
<sequential>
<presetdef name="javadoc">
<javadoc executable="@{javadocval}"/>
</presetdef>
</sequential>
</macrodef>
<javadoc-presetdef javadocval="${nbjdk.javadoc}"/>
<macrodef name="junit-presetdef">
<attribute name="javaval"/>
<sequential>
<presetdef name="junit">
<junit fork="yes" jvm="@{javaval}"/>
</presetdef>
</sequential>
</macrodef>
<junit-presetdef javaval="${nbjdk.java}"/>
<property name="nbjdk.presetdef.basic.done" value="true"/>
</target>

<target name="-jdk-presetdef-nbjpdastart" depends="-jdk-preinit" if="nbjdk.valid" unless="nbjdk.presetdef.nbjpdastart.done">
<macrodef name="nbjpdastart-presetdef">
<attribute name="bootcpval"/>
<sequential>
<presetdef name="nbjpdastart">
<nbjpdastart>
<bootclasspath>
<path path="@{bootcpval}"/>
</bootclasspath>
</nbjpdastart>
</presetdef>
</sequential>
</macrodef>
<nbjpdastart-presetdef bootcpval="${nbjdk.bootclasspath}"/>
<property name="nbjdk.presetdef.nbjpdastart.done" value="true"/>
</target>

<target name="-jdk-default" unless="nbjdk.active-or-nbjdk.home">

<property name="java.home.parent" location="${java.home}/.."/>
<condition property="nbjdk.home" value="${java.home.parent}">
<available file="${java.home.parent}/lib/tools.jar" type="file"/>
</condition>
<condition property="nbjdk.home" value="${java.home}">
<available file="${java.home}/lib/tools.jar" type="file"/>
</condition>

<condition property="nbjdk.home" value="/Library/Java/Home">
<available file="/Library/Java/Home" type="dir"/>
</condition>

<property name="nbjdk.home" location="${java.home.parent}"/>
<property name="nbjdk.home.defaulted" value="true"/>
</target>

<target name="-jdk-init" depends="-jdk-preinit,-jdk-warn,-jdk-presetdef-basic,-jdk-default"/>

</project>
1 change: 1 addition & 0 deletions nbproject/nbjdk.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nbjdk.active=default_platform
40 changes: 40 additions & 0 deletions nbproject/nbjdk.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<project basedir=".." name="BTrace">
<property file="nbproject/nbjdk.properties"/>
<property location="${netbeans.user}/build.properties" name="user.properties.file"/>
<property file="${user.properties.file}"/>
<import file="jdk.xml"/>
<target depends="-jdk-init" name="jar">
<ant antfile="make/build.xml" inheritall="false" target="jar"/>
</target>
<target depends="-jdk-init" name="clean">
<ant antfile="make/build.xml" inheritall="false" target="clean"/>
</target>
<target depends="-jdk-init" name="test">
<ant antfile="make/build.xml" inheritall="false" target="test"/>
</target>
<target depends="-jdk-init" name="javadoc">
<ant antfile="make/build.xml" inheritall="false" target="javadoc"/>
</target>
<target depends="-jdk-init,-jdk-presetdef-nbjpdastart" name="debug-selected-file-in-classes">
<ant antfile="nbproject/ide-file-targets.xml" inheritall="false" target="debug-selected-file-in-classes"/>
</target>
<target depends="-jdk-init" name="run-selected-file-in-classes">
<ant antfile="nbproject/ide-file-targets.xml" inheritall="false" target="run-selected-file-in-classes"/>
</target>
<target depends="-jdk-init,-jdk-presetdef-nbjpdastart" name="debug-selected-file-in-test">
<ant antfile="nbproject/ide-file-targets.xml" inheritall="false" target="debug-selected-file-in-test"/>
</target>
<target depends="-jdk-init" name="run-selected-file-in-test">
<ant antfile="nbproject/ide-file-targets.xml" inheritall="false" target="run-selected-file-in-test"/>
</target>
<target depends="-jdk-init" name="compile-selected-btrace-files">
<ant antfile="nbproject/ide-file-targets.xml" inheritall="false" target="compile-selected-btrace-files"/>
</target>
<target depends="-jdk-init" name="compile-selected-files-in-test">
<ant antfile="nbproject/ide-file-targets.xml" inheritall="false" target="compile-selected-files-in-test"/>
</target>
<target depends="-jdk-init" name="compile-selected-files-in-classes">
<ant antfile="nbproject/ide-file-targets.xml" inheritall="false" target="compile-selected-files-in-classes"/>
</target>
</project>
30 changes: 15 additions & 15 deletions nbproject/project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,28 +41,28 @@
</folders>
<ide-actions>
<action name="build">
<script>${ant.script}</script>
<script>nbproject/nbjdk.xml</script>
<target>jar</target>
</action>
<action name="clean">
<script>${ant.script}</script>
<script>nbproject/nbjdk.xml</script>
<target>clean</target>
</action>
<action name="rebuild">
<script>${ant.script}</script>
<script>nbproject/nbjdk.xml</script>
<target>clean</target>
<target>jar</target>
</action>
<action name="test">
<script>${ant.script}</script>
<script>nbproject/nbjdk.xml</script>
<target>test</target>
</action>
<action name="javadoc">
<script>${ant.script}</script>
<script>nbproject/nbjdk.xml</script>
<target>javadoc</target>
</action>
<action name="debug.single">
<script>nbproject/ide-file-targets.xml</script>
<script>nbproject/nbjdk.xml</script>
<target>debug-selected-file-in-classes</target>
<context>
<property>debug.class</property>
Expand All @@ -75,7 +75,7 @@
</context>
</action>
<action name="run.single">
<script>nbproject/ide-file-targets.xml</script>
<script>nbproject/nbjdk.xml</script>
<target>run-selected-file-in-classes</target>
<context>
<property>run.class</property>
Expand All @@ -88,7 +88,7 @@
</context>
</action>
<action name="debug.single">
<script>nbproject/ide-file-targets.xml</script>
<script>nbproject/nbjdk.xml</script>
<target>debug-selected-file-in-test</target>
<context>
<property>debug.class</property>
Expand All @@ -101,7 +101,7 @@
</context>
</action>
<action name="run.single">
<script>nbproject/ide-file-targets.xml</script>
<script>nbproject/nbjdk.xml</script>
<target>run-selected-file-in-test</target>
<context>
<property>run.class</property>
Expand All @@ -114,7 +114,7 @@
</context>
</action>
<action name="compile.single">
<script>nbproject/ide-file-targets.xml</script>
<script>nbproject/nbjdk.xml</script>
<target>compile-selected-btrace-files</target>
<context>
<property>files</property>
Expand All @@ -127,7 +127,7 @@
</context>
</action>
<action name="compile.single">
<script>nbproject/ide-file-targets.xml</script>
<script>nbproject/nbjdk.xml</script>
<target>compile-selected-files-in-test</target>
<context>
<property>files</property>
Expand All @@ -140,7 +140,7 @@
</context>
</action>
<action name="compile.single">
<script>nbproject/ide-file-targets.xml</script>
<script>nbproject/nbjdk.xml</script>
<target>compile-selected-files-in-classes</target>
<context>
<property>files</property>
Expand All @@ -156,13 +156,13 @@
<export>
<type>folder</type>
<location>build/classes</location>
<script>${ant.script}</script>
<script>nbproject/nbjdk.xml</script>
<build-target>jar</build-target>
</export>
<export>
<type>folder</type>
<location>build/test</location>
<script>${ant.script}</script>
<script>nbproject/nbjdk.xml</script>
<build-target>jar</build-target>
</export>
<view>
Expand Down Expand Up @@ -233,7 +233,7 @@
<compilation-unit>
<package-root>src/test</package-root>
<unit-tests/>
<classpath mode="compile">build/classes:test-lib/asm-${asm.version}.jar:lib/btrace-asm-${asm.version}.jar:test-lib/asm-util-${asm.version}.jar:${junit.jar}</classpath>
<classpath mode="compile">build/classes:test-lib/asm-${asm.version}.jar:lib/btrace-asm-${asm.version}.jar:test-lib/asm-all-${asm.version}.jar:${junit.jar}</classpath>
<built-to>build/test</built-to>
<source-level>1.5</source-level>
</compilation-unit>
Expand Down
7 changes: 5 additions & 2 deletions src/share/classes/com/sun/btrace/BTraceRuntime.java
Original file line number Diff line number Diff line change
Expand Up @@ -1005,8 +1005,11 @@ public static void retransform(String runtimeName, Class<?> clazz) {
if (rt != null && rt.instrumentation.isModifiableClass(clazz)) {
rt.instrumentation.retransformClasses(clazz);
}
} catch (Exception e) {
e.printStackTrace();
} catch (Throwable e) {
if (e instanceof VerifyError) {
System.out.println("btrace DEBUG: " + ((VerifyError)e).getMessage());
}
e.printStackTrace(System.out);
}
}

Expand Down
Loading

0 comments on commit 7c4dc30

Please sign in to comment.