diff --git a/.idea/artifacts/debugger_agent.xml b/.idea/artifacts/debugger_agent.xml
index 20a3fbb1b948..f1fd0dc26d46 100644
--- a/.idea/artifacts/debugger_agent.xml
+++ b/.idea/artifacts/debugger_agent.xml
@@ -6,6 +6,7 @@
+
\ No newline at end of file
diff --git a/java/debugger/debugger-agent/intellij.java.debugger.agent.iml b/java/debugger/debugger-agent/intellij.java.debugger.agent.iml
index 3d1585a86a12..422690119518 100644
--- a/java/debugger/debugger-agent/intellij.java.debugger.agent.iml
+++ b/java/debugger/debugger-agent/intellij.java.debugger.agent.iml
@@ -7,7 +7,15 @@
-
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/java/debugger/debugger-agent/lib/asm-capture.jar b/java/debugger/debugger-agent/lib/asm-capture.jar
new file mode 100644
index 000000000000..7c3d0b3dff47
Binary files /dev/null and b/java/debugger/debugger-agent/lib/asm-capture.jar differ
diff --git a/java/debugger/debugger-agent/src/com/intellij/rt/debugger/agent/CaptureAgent.java b/java/debugger/debugger-agent/src/com/intellij/rt/debugger/agent/CaptureAgent.java
index cfdfe2aabcfc..fe96044667dd 100644
--- a/java/debugger/debugger-agent/src/com/intellij/rt/debugger/agent/CaptureAgent.java
+++ b/java/debugger/debugger-agent/src/com/intellij/rt/debugger/agent/CaptureAgent.java
@@ -1,7 +1,7 @@
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.rt.debugger.agent;
-import org.jetbrains.org.objectweb.asm.*;
+import org.jetbrains.capture.org.objectweb.asm.*;
import java.io.File;
import java.io.FileOutputStream;
@@ -12,7 +12,6 @@ import java.lang.instrument.Instrumentation;
import java.lang.instrument.UnmodifiableClassException;
import java.security.ProtectionDomain;
import java.util.*;
-import java.util.jar.JarFile;
/**
* @author egor
@@ -28,26 +27,7 @@ public class CaptureAgent {
public static void premain(String args, Instrumentation instrumentation) {
ourInstrumentation = instrumentation;
try {
- String asmPath = readSettings(args);
-
- if (asmPath == null) {
- return;
- }
-
- try {
- instrumentation.appendToSystemClassLoaderSearch(new JarFile(asmPath));
- }
- catch (Exception e) {
- String report = "Capture agent: unable to use the provided asm lib";
- try {
- Class.forName("org.jetbrains.org.objectweb.asm.MethodVisitor");
- System.out.println(report + ", will use asm from the classpath");
- }
- catch (ClassNotFoundException e1) {
- System.out.println(report + ", exiting");
- return;
- }
- }
+ readSettings(args);
instrumentation.addTransformer(new CaptureTransformer());
@@ -87,7 +67,7 @@ public class CaptureAgent {
System.setProperty(modulesKey, property);
}
- private static String readSettings(String path) {
+ private static void readSettings(String path) {
FileReader reader = null;
try {
reader = new FileReader(path);
@@ -105,12 +85,6 @@ public class CaptureAgent {
boolean deleteSettings = Boolean.parseBoolean(properties.getProperty("deleteSettings", "true"));
- String asmPath = properties.getProperty("asm-lib");
- if (asmPath == null) {
- System.out.println("Capture agent: asm path is not specified, exiting");
- return null;
- }
-
Enumeration> propNames = properties.propertyNames();
while (propNames.hasMoreElements()) {
String propName = (String)propNames.nextElement();
@@ -126,7 +100,6 @@ public class CaptureAgent {
if (deleteSettings) {
new File(path).delete();
}
- return asmPath;
}
catch (IOException e) {
System.out.println("Capture agent: unable to read settings");
@@ -142,7 +115,6 @@ public class CaptureAgent {
}
}
}
- return null;
}
private static List getNotNull(List list) {
diff --git a/java/debugger/impl/src/com/intellij/debugger/impl/DebuggerManagerImpl.java b/java/debugger/impl/src/com/intellij/debugger/impl/DebuggerManagerImpl.java
index ba2191459654..b156f9fcdbe3 100644
--- a/java/debugger/impl/src/com/intellij/debugger/impl/DebuggerManagerImpl.java
+++ b/java/debugger/impl/src/com/intellij/debugger/impl/DebuggerManagerImpl.java
@@ -52,7 +52,6 @@ import org.jdom.Element;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
-import org.jetbrains.org.objectweb.asm.MethodVisitor;
import javax.swing.*;
import java.io.File;
@@ -597,7 +596,6 @@ public class DebuggerManagerImpl extends DebuggerManagerEx implements Persistent
private static String generateAgentSettings() {
Properties properties = new Properties();
- properties.setProperty("asm-lib", PathUtil.getJarPathForClass(MethodVisitor.class));
if (Registry.is("debugger.capture.points.agent.debug")) {
properties.setProperty("debug", "true");
}