Evaluate expression: test cache using logger
This commit is contained in:
+5
-1
@@ -39,6 +39,7 @@ import org.jetbrains.jet.plugin.caches.resolve.JavaResolveExtension
|
|||||||
import org.jetbrains.jet.lang.resolve.java.structure.impl.JavaClassImpl
|
import org.jetbrains.jet.lang.resolve.java.structure.impl.JavaClassImpl
|
||||||
import org.jetbrains.jet.lang.resolve.java.JvmClassName
|
import org.jetbrains.jet.lang.resolve.java.JvmClassName
|
||||||
import org.jetbrains.jet.codegen.AsmUtil
|
import org.jetbrains.jet.codegen.AsmUtil
|
||||||
|
import org.apache.log4j.Logger
|
||||||
|
|
||||||
class KotlinEvaluateExpressionCache(val project: Project) {
|
class KotlinEvaluateExpressionCache(val project: Project) {
|
||||||
|
|
||||||
@@ -49,6 +50,8 @@ class KotlinEvaluateExpressionCache(val project: Project) {
|
|||||||
}, false)
|
}, false)
|
||||||
|
|
||||||
class object {
|
class object {
|
||||||
|
private val LOG = Logger.getLogger(javaClass<KotlinEvaluateExpressionCache>())!!
|
||||||
|
|
||||||
fun getInstance(project: Project) = ServiceManager.getService(project, javaClass<KotlinEvaluateExpressionCache>())!!
|
fun getInstance(project: Project) = ServiceManager.getService(project, javaClass<KotlinEvaluateExpressionCache>())!!
|
||||||
|
|
||||||
fun getOrCreateCompiledData(
|
fun getOrCreateCompiledData(
|
||||||
@@ -70,8 +73,9 @@ class KotlinEvaluateExpressionCache(val project: Project) {
|
|||||||
if (answer != null) return@synchronized answer
|
if (answer != null) return@synchronized answer
|
||||||
|
|
||||||
val newCompiledData = create(codeFragment, sourcePosition)
|
val newCompiledData = create(codeFragment, sourcePosition)
|
||||||
cache.putValue(text, newCompiledData)
|
LOG.debug("Compile bytecode for ${codeFragment.getText()}")
|
||||||
|
|
||||||
|
cache.putValue(text, newCompiledData)
|
||||||
return@synchronized newCompiledData
|
return@synchronized newCompiledData
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ LineBreakpoint created at abstractFunCall.kt:5
|
|||||||
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!RT_JAR! abstractFunCall.AbstractFunCallPackage
|
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!RT_JAR! abstractFunCall.AbstractFunCallPackage
|
||||||
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
abstractFunCall.kt:4
|
abstractFunCall.kt:4
|
||||||
|
Compile bytecode for (1 as java.lang.Number).intValue()
|
||||||
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
|
|
||||||
Process finished with exit code 0
|
Process finished with exit code 0
|
||||||
|
|||||||
@@ -2,6 +2,15 @@ LineBreakpoint created at arrays.kt:5
|
|||||||
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!RT_JAR! arrays.ArraysPackage
|
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!RT_JAR! arrays.ArraysPackage
|
||||||
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
arrays.kt:4
|
arrays.kt:4
|
||||||
|
Compile bytecode for array(1, 2).map { it.toString() }
|
||||||
|
Compile bytecode for array(1, 2, 101, 102).filter { it > 100 }
|
||||||
|
Compile bytecode for array(1, 2).none()
|
||||||
|
Compile bytecode for array(1, 2).count()
|
||||||
|
Compile bytecode for array(1, 2).size
|
||||||
|
Compile bytecode for array(1, 2).first()
|
||||||
|
Compile bytecode for array(1, 2).last()
|
||||||
|
Compile bytecode for intArray(1, 2).max()
|
||||||
|
Compile bytecode for array(1, 2).max()
|
||||||
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
|
|
||||||
Process finished with exit code 0
|
Process finished with exit code 0
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ LineBreakpoint created at classFromAnotherPackage.kt:7
|
|||||||
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!RT_JAR! classFromAnotherPackage.ClassFromAnotherPackagePackage
|
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!RT_JAR! classFromAnotherPackage.ClassFromAnotherPackagePackage
|
||||||
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
classFromAnotherPackage.kt:6
|
classFromAnotherPackage.kt:6
|
||||||
|
Compile bytecode for MyJavaClass()
|
||||||
|
Compile bytecode for stepInto.MyJavaClass()
|
||||||
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
|
|
||||||
Process finished with exit code 0
|
Process finished with exit code 0
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ LineBreakpoint created at classObjectVal.kt:10
|
|||||||
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!RT_JAR! classObjectVal.ClassObjectValPackage
|
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!RT_JAR! classObjectVal.ClassObjectValPackage
|
||||||
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
classObjectVal.kt:9
|
classObjectVal.kt:9
|
||||||
|
Compile bytecode for coProp
|
||||||
|
Compile bytecode for MyClass.coProp
|
||||||
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
|
|
||||||
Process finished with exit code 0
|
Process finished with exit code 0
|
||||||
|
|||||||
@@ -20,26 +20,38 @@ LineBreakpoint created at clearCache.kt:189
|
|||||||
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!RT_JAR! clearCache.ClearCachePackage
|
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!RT_JAR! clearCache.ClearCachePackage
|
||||||
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
clearCache.kt:11
|
clearCache.kt:11
|
||||||
|
Compile bytecode for a
|
||||||
clearCache.kt:19
|
clearCache.kt:19
|
||||||
|
Compile bytecode for a
|
||||||
clearCache.kt:30
|
clearCache.kt:30
|
||||||
|
Compile bytecode for i
|
||||||
clearCache.kt:30
|
clearCache.kt:30
|
||||||
clearCache.kt:41
|
clearCache.kt:41
|
||||||
|
Compile bytecode for i
|
||||||
clearCache.kt:41
|
clearCache.kt:41
|
||||||
clearCache.kt:51
|
clearCache.kt:51
|
||||||
|
Compile bytecode for o.test()
|
||||||
clearCache.kt:59
|
clearCache.kt:59
|
||||||
clearCache.kt:77
|
clearCache.kt:77
|
||||||
|
Compile bytecode for c.size()
|
||||||
clearCache.kt:85
|
clearCache.kt:85
|
||||||
clearCache.kt:94
|
clearCache.kt:94
|
||||||
clearCache.kt:104
|
clearCache.kt:104
|
||||||
clearCache.kt:112
|
clearCache.kt:112
|
||||||
|
Compile bytecode for c.size()
|
||||||
clearCache.kt:123
|
clearCache.kt:123
|
||||||
|
Compile bytecode for c.get(0)
|
||||||
clearCache.kt:132
|
clearCache.kt:132
|
||||||
clearCache.kt:142
|
clearCache.kt:142
|
||||||
|
Compile bytecode for o.test()
|
||||||
clearCache.kt:150
|
clearCache.kt:150
|
||||||
clearCache.kt:168
|
clearCache.kt:168
|
||||||
|
Compile bytecode for obj.test()
|
||||||
clearCache.kt:173
|
clearCache.kt:173
|
||||||
clearCache.kt:180
|
clearCache.kt:180
|
||||||
|
Compile bytecode for o.test()
|
||||||
clearCache.kt:188
|
clearCache.kt:188
|
||||||
|
Compile bytecode for o.test()
|
||||||
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
|
|
||||||
Process finished with exit code 0
|
Process finished with exit code 0
|
||||||
|
|||||||
@@ -2,6 +2,17 @@ LineBreakpoint created at collections.kt:6
|
|||||||
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!RT_JAR! collections.CollectionsPackage
|
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!RT_JAR! collections.CollectionsPackage
|
||||||
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
collections.kt:5
|
collections.kt:5
|
||||||
|
Compile bytecode for arrayListOf(1, 2).map { it.toString() }
|
||||||
|
Compile bytecode for arrayListOf(1, 2, 101, 102).filter { it > 100 }
|
||||||
|
Compile bytecode for arrayListOf(1, 2).max()
|
||||||
|
Compile bytecode for arrayListOf(1, 2).count()
|
||||||
|
Compile bytecode for arrayListOf(1, 2).size
|
||||||
|
Compile bytecode for arrayListOf(1, 2).drop(1)
|
||||||
|
Compile bytecode for ar.map { if (it > 50) "big" else "small" }
|
||||||
|
.filter { it == "small" }
|
||||||
|
.size
|
||||||
|
|
||||||
|
// RESULT: 2: I
|
||||||
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
|
|
||||||
Process finished with exit code 0
|
Process finished with exit code 0
|
||||||
|
|||||||
@@ -2,6 +2,14 @@ LineBreakpoint created at dependentOnFile.kt:5
|
|||||||
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!RT_JAR! dependentOnFile.DependentOnFilePackage
|
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!RT_JAR! dependentOnFile.DependentOnFilePackage
|
||||||
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
dependentOnFile.kt:4
|
dependentOnFile.kt:4
|
||||||
|
Compile bytecode for TestClass().testFun()
|
||||||
|
Compile bytecode for testFun()
|
||||||
|
Compile bytecode for TestObject.p
|
||||||
|
Compile bytecode for TestClass.p
|
||||||
|
Compile bytecode for 1.testExtFun()
|
||||||
|
Compile bytecode for testVal
|
||||||
|
Compile bytecode for 1.testExtVal
|
||||||
|
Compile bytecode for testDelVal
|
||||||
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
|
|
||||||
Process finished with exit code 0
|
Process finished with exit code 0
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ LineBreakpoint created at doubles.kt:7
|
|||||||
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!RT_JAR! doubles.DoublesPackage
|
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!RT_JAR! doubles.DoublesPackage
|
||||||
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
doubles.kt:6
|
doubles.kt:6
|
||||||
|
Compile bytecode for d1 + d2
|
||||||
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
|
|
||||||
Process finished with exit code 0
|
Process finished with exit code 0
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ LineBreakpoint created at enums.kt:7
|
|||||||
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!RT_JAR! enums.EnumsPackage
|
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!RT_JAR! enums.EnumsPackage
|
||||||
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
enums.kt:6
|
enums.kt:6
|
||||||
|
Compile bytecode for A == MyEnum.A
|
||||||
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
|
|
||||||
Process finished with exit code 0
|
Process finished with exit code 0
|
||||||
|
|||||||
@@ -2,6 +2,10 @@ LineBreakpoint created at extractLocalVariables.kt:7
|
|||||||
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!RT_JAR! extractLocalVariables.ExtractLocalVariablesPackage
|
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!RT_JAR! extractLocalVariables.ExtractLocalVariablesPackage
|
||||||
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
extractLocalVariables.kt:6
|
extractLocalVariables.kt:6
|
||||||
|
Compile bytecode for a
|
||||||
|
Compile bytecode for klass.f1(1)
|
||||||
|
Compile bytecode for args.size
|
||||||
|
Compile bytecode for klass.b
|
||||||
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
|
|
||||||
Process finished with exit code 0
|
Process finished with exit code 0
|
||||||
|
|||||||
@@ -2,6 +2,9 @@ LineBreakpoint created at extractThis.kt:13
|
|||||||
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!RT_JAR! extractThis.ExtractThisPackage
|
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!RT_JAR! extractThis.ExtractThisPackage
|
||||||
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
extractThis.kt:12
|
extractThis.kt:12
|
||||||
|
Compile bytecode for prop
|
||||||
|
Compile bytecode for this.prop
|
||||||
|
Compile bytecode for prop + a
|
||||||
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
|
|
||||||
Process finished with exit code 0
|
Process finished with exit code 0
|
||||||
|
|||||||
@@ -2,6 +2,10 @@ LineBreakpoint created at extractVariablesFromCall.kt:8
|
|||||||
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!RT_JAR! extractVariablesFromCall.ExtractVariablesFromCallPackage
|
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!RT_JAR! extractVariablesFromCall.ExtractVariablesFromCallPackage
|
||||||
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
extractVariablesFromCall.kt:7
|
extractVariablesFromCall.kt:7
|
||||||
|
Compile bytecode for f1(a, s)
|
||||||
|
Compile bytecode for a.f2(s)
|
||||||
|
Compile bytecode for a f2 s
|
||||||
|
Compile bytecode for klass.f1(a, s)
|
||||||
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
|
|
||||||
Process finished with exit code 0
|
Process finished with exit code 0
|
||||||
|
|||||||
@@ -2,6 +2,10 @@ LineBreakpoint created at imports.kt:10
|
|||||||
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!RT_JAR! imports.ImportsPackage
|
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!RT_JAR! imports.ImportsPackage
|
||||||
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
imports.kt:9
|
imports.kt:9
|
||||||
|
Compile bytecode for Collections.emptyList<String>()
|
||||||
|
Compile bytecode for ArrayList<Int>()
|
||||||
|
Compile bytecode for HashSet<Int>()
|
||||||
|
Compile bytecode for JHashMap<Int, Int>()
|
||||||
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
|
|
||||||
Process finished with exit code 0
|
Process finished with exit code 0
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ LineBreakpoint created at insertInBlock.kt:6
|
|||||||
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!RT_JAR! insertInBlock.InsertInBlockPackage
|
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!RT_JAR! insertInBlock.InsertInBlockPackage
|
||||||
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
insertInBlock.kt:5
|
insertInBlock.kt:5
|
||||||
|
Compile bytecode for 1 + 1
|
||||||
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
|
|
||||||
Process finished with exit code 0
|
Process finished with exit code 0
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ LineBreakpoint created at multilineExpressionAtBreakpoint.kt:5
|
|||||||
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!RT_JAR! multilineExpressionAtBreakpoint.MultilineExpressionAtBreakpointPackage
|
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!RT_JAR! multilineExpressionAtBreakpoint.MultilineExpressionAtBreakpointPackage
|
||||||
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
multilineExpressionAtBreakpoint.kt:4
|
multilineExpressionAtBreakpoint.kt:4
|
||||||
|
Compile bytecode for 1 + 1
|
||||||
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
|
|
||||||
Process finished with exit code 0
|
Process finished with exit code 0
|
||||||
|
|||||||
@@ -2,6 +2,9 @@ LineBreakpoint created at privateMember.kt:5
|
|||||||
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!RT_JAR! privateMember.PrivateMemberPackage
|
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!RT_JAR! privateMember.PrivateMemberPackage
|
||||||
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
privateMember.kt:4
|
privateMember.kt:4
|
||||||
|
Compile bytecode for MyClass().privateFun()
|
||||||
|
Compile bytecode for MyClass().privateVal
|
||||||
|
Compile bytecode for MyClass.PrivateClass().a
|
||||||
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
|
|
||||||
Process finished with exit code 0
|
Process finished with exit code 0
|
||||||
|
|||||||
@@ -2,6 +2,9 @@ LineBreakpoint created at protectedMember.kt:5
|
|||||||
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!RT_JAR! protectedMember.ProtectedMemberPackage
|
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!RT_JAR! protectedMember.ProtectedMemberPackage
|
||||||
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
protectedMember.kt:4
|
protectedMember.kt:4
|
||||||
|
Compile bytecode for MyClass().protectedFun()
|
||||||
|
Compile bytecode for MyClass().protectedVal
|
||||||
|
Compile bytecode for MyClass.ProtectedClass().a
|
||||||
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
|
|
||||||
Process finished with exit code 0
|
Process finished with exit code 0
|
||||||
|
|||||||
@@ -2,6 +2,13 @@ LineBreakpoint created at simple.kt:5
|
|||||||
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!RT_JAR! simple.SimplePackage
|
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!RT_JAR! simple.SimplePackage
|
||||||
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
simple.kt:4
|
simple.kt:4
|
||||||
|
Compile bytecode for 1
|
||||||
|
Compile bytecode for 1 + 1
|
||||||
|
Compile bytecode for val a = 1
|
||||||
|
a + args.size
|
||||||
|
|
||||||
|
// RESULT: 1: I
|
||||||
|
|
||||||
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
|
|
||||||
Process finished with exit code 0
|
Process finished with exit code 0
|
||||||
|
|||||||
@@ -2,6 +2,13 @@ LineBreakpoint created at stdlib.kt:5
|
|||||||
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!RT_JAR! stdlib.StdlibPackage
|
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!RT_JAR! stdlib.StdlibPackage
|
||||||
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
stdlib.kt:4
|
stdlib.kt:4
|
||||||
|
Compile bytecode for array(100, 101)
|
||||||
|
Compile bytecode for array("a", "b", "c")
|
||||||
|
Compile bytecode for intArray(1, 2)
|
||||||
|
Compile bytecode for javaClass<String>()
|
||||||
|
Compile bytecode for javaClass<Int>()
|
||||||
|
Compile bytecode for 100.toInt()
|
||||||
|
Compile bytecode for 100.toLong()
|
||||||
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
|
|
||||||
Process finished with exit code 0
|
Process finished with exit code 0
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ LineBreakpoint created at vars.kt:7
|
|||||||
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!RT_JAR! vars.VarsPackage
|
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!RT_JAR! vars.VarsPackage
|
||||||
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
vars.kt:6
|
vars.kt:6
|
||||||
|
Compile bytecode for a
|
||||||
|
Compile bytecode for a += 1
|
||||||
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
|
|
||||||
Process finished with exit code 0
|
Process finished with exit code 0
|
||||||
|
|||||||
+39
-5
@@ -35,8 +35,40 @@ import com.sun.jdi.ObjectReference
|
|||||||
import org.jetbrains.jet.lang.psi.JetCodeFragment
|
import org.jetbrains.jet.lang.psi.JetCodeFragment
|
||||||
import java.util.Collections
|
import java.util.Collections
|
||||||
import com.intellij.debugger.engine.evaluation.EvaluateException
|
import com.intellij.debugger.engine.evaluation.EvaluateException
|
||||||
|
import com.intellij.execution.process.ProcessOutputTypes
|
||||||
|
import org.apache.log4j.AppenderSkeleton
|
||||||
|
import org.apache.log4j.spi.LoggingEvent
|
||||||
|
import org.apache.log4j.Level
|
||||||
|
import org.apache.log4j.Logger
|
||||||
|
|
||||||
public abstract class AbstractKotlinEvaluateExpressionTest : KotlinDebuggerTestCase() {
|
public abstract class AbstractKotlinEvaluateExpressionTest : KotlinDebuggerTestCase() {
|
||||||
|
private val logger = Logger.getLogger(javaClass<KotlinEvaluateExpressionCache>())!!
|
||||||
|
|
||||||
|
private val appender = object : AppenderSkeleton() {
|
||||||
|
override fun append(event: LoggingEvent?) {
|
||||||
|
println(event?.getRenderedMessage(), ProcessOutputTypes.SYSTEM)
|
||||||
|
}
|
||||||
|
override fun close() {}
|
||||||
|
override fun requiresLayout() = false
|
||||||
|
}
|
||||||
|
|
||||||
|
private var oldLogLevel: Level? = null
|
||||||
|
|
||||||
|
override fun setUp() {
|
||||||
|
super<KotlinDebuggerTestCase>.setUp()
|
||||||
|
|
||||||
|
oldLogLevel = logger.getLevel()
|
||||||
|
logger.setLevel(Level.DEBUG)
|
||||||
|
logger.addAppender(appender)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun tearDown() {
|
||||||
|
logger.setLevel(oldLogLevel)
|
||||||
|
logger.removeAppender(appender)
|
||||||
|
|
||||||
|
super<KotlinDebuggerTestCase>.tearDown()
|
||||||
|
}
|
||||||
|
|
||||||
fun doSingleBreakpointTest(path: String) {
|
fun doSingleBreakpointTest(path: String) {
|
||||||
val file = File(path)
|
val file = File(path)
|
||||||
val expressions = loadTestDirectivesPairs(file, "// EXPRESSION: ", "// RESULT: ")
|
val expressions = loadTestDirectivesPairs(file, "// EXPRESSION: ", "// RESULT: ")
|
||||||
@@ -84,6 +116,8 @@ public abstract class AbstractKotlinEvaluateExpressionTest : KotlinDebuggerTestC
|
|||||||
finish()
|
finish()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private fun checkExceptions(exceptions: MutableMap<String, Throwable>) {
|
private fun checkExceptions(exceptions: MutableMap<String, Throwable>) {
|
||||||
if (!exceptions.empty) {
|
if (!exceptions.empty) {
|
||||||
for (exc in exceptions.values()) {
|
for (exc in exceptions.values()) {
|
||||||
@@ -137,10 +171,10 @@ public abstract class AbstractKotlinEvaluateExpressionTest : KotlinDebuggerTestC
|
|||||||
|
|
||||||
val evaluator = DebuggerInvocationUtil.commitAndRunReadAction(getProject()) {
|
val evaluator = DebuggerInvocationUtil.commitAndRunReadAction(getProject()) {
|
||||||
EvaluatorBuilderImpl.build(TextWithImportsImpl(
|
EvaluatorBuilderImpl.build(TextWithImportsImpl(
|
||||||
codeFragmentKind,
|
codeFragmentKind,
|
||||||
text,
|
text,
|
||||||
JetCodeFragment.getImportsForElement(contextElement),
|
JetCodeFragment.getImportsForElement(contextElement),
|
||||||
JetFileType.INSTANCE),
|
JetFileType.INSTANCE),
|
||||||
contextElement,
|
contextElement,
|
||||||
sourcePosition)
|
sourcePosition)
|
||||||
}
|
}
|
||||||
@@ -151,7 +185,7 @@ public abstract class AbstractKotlinEvaluateExpressionTest : KotlinDebuggerTestC
|
|||||||
Assert.assertTrue("Evaluate expression returns wrong result for $text:\nexpected = $expectedResult\nactual = $actualResult\n", expectedResult == actualResult)
|
Assert.assertTrue("Evaluate expression returns wrong result for $text:\nexpected = $expectedResult\nactual = $actualResult\n", expectedResult == actualResult)
|
||||||
}
|
}
|
||||||
catch (e: EvaluateException) {
|
catch (e: EvaluateException) {
|
||||||
Assert.assertTrue("Evaluate expression throws wrong exception for $text:\nexpected = $expectedResult\nactual = ${e.getMessage()}\n", expectedResult == e.getMessage())
|
Assert.assertTrue("Evaluate expression throws wrong exception for $text:\nexpected = $expectedResult\nactual = ${e.getMessage()}\n", expectedResult == e.getMessage()?.replaceFirst("id=[0-9]*", "id=ID"))
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
resume(this)
|
resume(this)
|
||||||
|
|||||||
Reference in New Issue
Block a user