Fix for bug 378195: Support Hot Code Replacement for OT/Equinox
IDE part: automatically set -javaagent arg for OT/E debug launches.
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.adaptor/build.properties b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/build.properties
index d2ffc1e..b0e0e76 100644
--- a/plugins/org.eclipse.objectteams.otdt.debug.adaptor/build.properties
+++ b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/build.properties
@@ -4,7 +4,6 @@
output.. = bin/
bin.includes = META-INF/,\
.,\
- lib/,\
plugin.xml,\
plugin.properties,\
about.html
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.adaptor/customBuildCallbacks.xml b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/customBuildCallbacks.xml
index d279d72..54ab123 100644
--- a/plugins/org.eclipse.objectteams.otdt.debug.adaptor/customBuildCallbacks.xml
+++ b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/customBuildCallbacks.xml
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/PDELaunchingAdaptor.java b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/PDELaunchingAdaptor.java
index 2c3d0aa..75752d2 100644
--- a/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/PDELaunchingAdaptor.java
+++ b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/PDELaunchingAdaptor.java
@@ -26,6 +26,7 @@
import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.internal.core.util.Util;
+import org.eclipse.objectteams.otdt.core.ext.OTREContainer;
import org.eclipse.objectteams.otdt.debug.OTDebugPlugin;
import org.eclipse.objectteams.otdt.debug.TeamBreakpointInstaller;
import org.eclipse.objectteams.otdt.internal.debug.adaptor.DebugMessages;
@@ -60,9 +61,10 @@
static final String ENABLE_OTEQUINOX = "-Dot.equinox=1"; //$NON-NLS-1$ // this also causes the WORKAROUND_REPOSITORY flag being set to true in OTRE.
static final String DISABLE_OTEQUINOX = "-Dot.equinox=false"; //$NON-NLS-1$ // prevents TransformerHook installation and start of TransformerPlugin
static final String OT_DEBUG_VMARG = "-Dot.debug"; //$NON-NLS-1$
+ static final String OTE_AGENT_ARG = "-javaagent:" + OTREContainer.getOtequinoxAgentJarPath().toOSString();
// slot [0] to be filled in from the launch config:
static final String[] OT_VM_ARGS = { null, HOOK_CONFIGURATOR, CLASSLOADER_LOCKING, ENABLE_OTEQUINOX };
- static final String[] OT_VM_DEBUG_ARGS = { null, HOOK_CONFIGURATOR, CLASSLOADER_LOCKING, ENABLE_OTEQUINOX, OT_DEBUG_VMARG };
+ static final String[] OT_VM_DEBUG_ARGS = { null, HOOK_CONFIGURATOR, CLASSLOADER_LOCKING, ENABLE_OTEQUINOX, OT_DEBUG_VMARG, OTE_AGENT_ARG };
static final String[] VM_ARGS = { CLASSLOADER_LOCKING, DISABLE_OTEQUINOX };
static final String[] VM_DEBUG_ARGS = { CLASSLOADER_LOCKING, DISABLE_OTEQUINOX, OT_DEBUG_VMARG };
diff --git a/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTREContainer.java b/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTREContainer.java
index 2209862..fee5479 100644
--- a/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTREContainer.java
+++ b/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTREContainer.java
@@ -54,6 +54,7 @@
// these are served from the current plugin:
private static IPath OTRE_MIN_JAR_PATH;
private static IPath OTRE_AGENT_JAR_PATH;
+ private static IPath OTEQUINOX_AGENT_JAR_PATH;
public static IPath BCEL_PATH; // will be initialized in {@link findBCEL(BundleContext)}
@@ -64,6 +65,7 @@
// file names for the above OTRE_X_JAR_PATH constants:
private static final String OTRE_MIN_JAR_FILENAME = "otre_min.jar"; //$NON-NLS-1$
private static final String OTRE_AGENT_JAR_FILENAME = "otre_agent.jar"; //$NON-NLS-1$
+ private static final String OTEQUINOX_AGENT_JAR_FILENAME = "otequinoxAgent.jar"; //$NON-NLS-1$
// data for initializing the above BCEL_PATH:
private static final String BCEL_BUNDLE_NAME = "org.apache.bcel"; //$NON-NLS-1$
@@ -129,6 +131,16 @@
return OTRE_AGENT_JAR_PATH;
}
+ /**
+ * Answer the path of the "otequinoxAgent.jar" archive, which is passed as a -javaagent to the JVM for OT/Equinox debug launches.
+ * @return resolved path
+ */
+ public static IPath getOtequinoxAgentJarPath() {
+ if (OTEQUINOX_AGENT_JAR_PATH == null)
+ OTEQUINOX_AGENT_JAR_PATH = OTDTPlugin.getResolvedVariablePath(OTDTPlugin.OTDT_INSTALLDIR, "lib/"+OTEQUINOX_AGENT_JAR_FILENAME); //$NON-NLS-1$
+ return OTEQUINOX_AGENT_JAR_PATH;
+ }
+
/**
* Adds the ObjectTeams classes to the given JavaProject's classpath,
* and ensures the Java compliance is >= 1.5