diff --git a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt index 236daf94c98..e5f4dc3ec31 100644 --- a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt +++ b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt @@ -56,7 +56,6 @@ import org.jetbrains.kotlin.idea.conversion.copy.AbstractLiteralTextToKotlinCopy import org.jetbrains.kotlin.idea.conversion.copy.AbstractTextJavaToKotlinCopyPasteConversionTest import org.jetbrains.kotlin.idea.coverage.AbstractKotlinCoverageOutputFilesTest import org.jetbrains.kotlin.idea.debugger.* -import org.jetbrains.kotlin.idea.debugger.coroutines.AbstractCoroutineDumpTest import org.jetbrains.kotlin.idea.debugger.evaluate.* import org.jetbrains.kotlin.idea.debugger.test.sequence.exec.AbstractSequenceTraceTestCase import org.jetbrains.kotlin.idea.debugger.test.* @@ -227,6 +226,10 @@ fun main(args: Array) { model("asyncStackTrace") } + testClass { + model("coroutines") + } + testClass { // TODO: implement mapping logic for terminal operations model("sequence/streams/sequence", excludeDirs = listOf("terminal")) diff --git a/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/AbstractCoroutineDumpTest.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/AbstractCoroutineDumpTest.kt new file mode 100644 index 00000000000..0c74eccbd28 --- /dev/null +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/AbstractCoroutineDumpTest.kt @@ -0,0 +1,82 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.idea.debugger.test + +import com.intellij.debugger.engine.evaluation.EvaluationContextImpl +import com.intellij.execution.configurations.JavaParameters +import com.intellij.execution.process.ProcessOutputTypes +import com.intellij.jarRepository.JarRepositoryManager +import com.intellij.jarRepository.RemoteRepositoryDescription +import org.jetbrains.idea.maven.aether.ArtifactKind +import org.jetbrains.jps.model.library.JpsMavenRepositoryLibraryDescriptor +import org.jetbrains.kotlin.idea.debugger.coroutines.CoroutineState +import org.jetbrains.kotlin.idea.debugger.coroutines.CoroutinesDebugProbesProxy +import org.jetbrains.kotlin.idea.debugger.evaluate.ExecutionContext +import org.jetbrains.kotlin.idea.debugger.test.preference.DebuggerPreferences + +abstract class AbstractCoroutineDumpTest : KotlinDescriptorTestCaseWithStepping() { + + + override fun doMultiFileTest(files: TestFiles, preferences: DebuggerPreferences) { + + doOnBreakpoint { + val evalContext = EvaluationContextImpl(this, frameProxy) + val execContext = ExecutionContext(evalContext, frameProxy ?: return@doOnBreakpoint) + val either = CoroutinesDebugProbesProxy.dumpCoroutines(execContext) + try { + if (either.isRight) + try { + val states = either.get() + print(stringDump(states), ProcessOutputTypes.SYSTEM) + } catch (ignored: Throwable) { + } + else + throw AssertionError("Dump failed", either.left) + } finally { + resume(this) + } + } + + doOnBreakpoint { + val evalContext = EvaluationContextImpl(this, frameProxy) + val execContext = ExecutionContext(evalContext, frameProxy ?: return@doOnBreakpoint) + val either = CoroutinesDebugProbesProxy.dumpCoroutines(execContext) + try { + if (either.isRight) + try { + val states = either.get() + print(stringDump(states), ProcessOutputTypes.SYSTEM) + } catch (ignored: Throwable) { + } + else + throw AssertionError("Dump failed", either.left) + } finally { + resume(this) + } + } + } + + private fun stringDump(states: List) = buildString { + states.forEach { + appendln("\"${it.name}\", state: ${it.state}") + } + } + + override fun createJavaParameters(mainClass: String?): JavaParameters { + val description = JpsMavenRepositoryLibraryDescriptor("org.jetbrains.kotlinx", "kotlinx-coroutines-debug", "1.3.0") + val debugJar = JarRepositoryManager.loadDependenciesSync( + project, description, setOf(ArtifactKind.ARTIFACT), + RemoteRepositoryDescription.DEFAULT_REPOSITORIES, null + ) ?: throw AssertionError("Debug Dependency is not found") + val params = super.createJavaParameters(mainClass) + for (jar in debugJar) { + params.classPath.add(jar.file.presentableUrl) + if (jar.file.name.contains("kotlinx-coroutines-debug")) + params.vmParametersList.add("-javaagent:${jar.file.presentableUrl}") + } + return params + } +} \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/CoroutineDumpTestGenerated.java b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/CoroutineDumpTestGenerated.java new file mode 100644 index 00000000000..0867484d5e2 --- /dev/null +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/CoroutineDumpTestGenerated.java @@ -0,0 +1,46 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.idea.debugger.test; + +import com.intellij.testFramework.TestDataPath; +import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; +import org.jetbrains.kotlin.test.KotlinTestUtils; +import org.jetbrains.kotlin.test.TargetBackend; +import org.jetbrains.kotlin.test.TestMetadata; +import org.junit.runner.RunWith; + +import java.io.File; +import java.util.regex.Pattern; + +/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ +@SuppressWarnings("all") +@TestMetadata("idea/jvm-debugger/jvm-debugger-test/testData/coroutines") +@TestDataPath("$PROJECT_ROOT") +@RunWith(JUnit3RunnerWithInners.class) +public class CoroutineDumpTestGenerated extends AbstractCoroutineDumpTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); + } + + public void testAllFilesPresentInCoroutines() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/jvm-debugger/jvm-debugger-test/testData/coroutines"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } + + @TestMetadata("noCoroutines.kt") + public void testNoCoroutines() throws Exception { + runTest("idea/jvm-debugger/jvm-debugger-test/testData/coroutines/noCoroutines.kt"); + } + + @TestMetadata("threeCoroutines.kt") + public void testThreeCoroutines() throws Exception { + runTest("idea/jvm-debugger/jvm-debugger-test/testData/coroutines/threeCoroutines.kt"); + } + + @TestMetadata("twoDumps.kt") + public void testTwoDumps() throws Exception { + runTest("idea/jvm-debugger/jvm-debugger-test/testData/coroutines/twoDumps.kt"); + } +} diff --git a/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/KotlinEvaluateExpressionTestGenerated.java b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/KotlinEvaluateExpressionTestGenerated.java index 6e06bcd5417..b33f319d7ac 100644 --- a/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/KotlinEvaluateExpressionTestGenerated.java +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/KotlinEvaluateExpressionTestGenerated.java @@ -305,6 +305,21 @@ public class KotlinEvaluateExpressionTestGenerated extends AbstractKotlinEvaluat runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/kt31709.kt"); } + @TestMetadata("kt32691.kt") + public void testKt32691() throws Exception { + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/kt32691.kt"); + } + + @TestMetadata("kt33093.kt") + public void testKt33093() throws Exception { + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/kt33093.kt"); + } + + @TestMetadata("kt33181.kt") + public void testKt33181() throws Exception { + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/kt33181.kt"); + } + @TestMetadata("kt5554OnlyIntsShouldBeCoerced.kt") public void testKt5554OnlyIntsShouldBeCoerced() throws Exception { runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/kt5554OnlyIntsShouldBeCoerced.kt"); @@ -834,11 +849,21 @@ public class KotlinEvaluateExpressionTestGenerated extends AbstractKotlinEvaluat runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/frameLambda.kt"); } + @TestMetadata("frameLambdaNotAccessible.kt") + public void testFrameLambdaNotAccessible() throws Exception { + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/frameLambdaNotAccessible.kt"); + } + @TestMetadata("frameLambdaNotUsed.kt") public void testFrameLambdaNotUsed() throws Exception { runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/frameLambdaNotUsed.kt"); } + @TestMetadata("frameLambdaVariableFromCorrectFrame.kt") + public void testFrameLambdaVariableFromCorrectFrame() throws Exception { + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/frameLambdaVariableFromCorrectFrame.kt"); + } + @TestMetadata("frameLocalVariable.kt") public void testFrameLocalVariable() throws Exception { runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/frameLocalVariable.kt"); @@ -939,6 +964,11 @@ public class KotlinEvaluateExpressionTestGenerated extends AbstractKotlinEvaluat runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/nestedInlineFun2.kt"); } + @TestMetadata("nonCapturedThisInLambda.kt") + public void testNonCapturedThisInLambda() throws Exception { + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/nonCapturedThisInLambda.kt"); + } + @TestMetadata("remapThis.kt") public void testRemapThis() throws Exception { runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/remapThis.kt"); diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/coroutines/noCoroutines.kt b/idea/jvm-debugger/jvm-debugger-test/testData/coroutines/noCoroutines.kt new file mode 100644 index 00000000000..c855db5ee1f --- /dev/null +++ b/idea/jvm-debugger/jvm-debugger-test/testData/coroutines/noCoroutines.kt @@ -0,0 +1,6 @@ +package noCoroutines + +fun main() { + //Breakpoint! + val s = "nothing to see here, folks" +} \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/coroutines/noCoroutines.out b/idea/jvm-debugger/jvm-debugger-test/testData/coroutines/noCoroutines.out new file mode 100644 index 00000000000..b1080bd756f --- /dev/null +++ b/idea/jvm-debugger/jvm-debugger-test/testData/coroutines/noCoroutines.out @@ -0,0 +1,7 @@ +LineBreakpoint created at noCoroutines.kt:5 +Run Java +Connected to the target VM +noCoroutines.kt:5 +Disconnected from the target VM + +Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/coroutines/threeCoroutines.kt b/idea/jvm-debugger/jvm-debugger-test/testData/coroutines/threeCoroutines.kt new file mode 100644 index 00000000000..90f8e9be07f --- /dev/null +++ b/idea/jvm-debugger/jvm-debugger-test/testData/coroutines/threeCoroutines.kt @@ -0,0 +1,13 @@ +package threeCoroutines + +import kotlin.random.Random + +suspend fun main() { + sequence { + yield(239) + sequence { + //Breakpoint! + yield(666) + }.toList() + }.toList() +} diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/coroutines/threeCoroutines.out b/idea/jvm-debugger/jvm-debugger-test/testData/coroutines/threeCoroutines.out new file mode 100644 index 00000000000..110fff9ad6c --- /dev/null +++ b/idea/jvm-debugger/jvm-debugger-test/testData/coroutines/threeCoroutines.out @@ -0,0 +1,10 @@ +LineBreakpoint created at threeCoroutines.kt:10 +Run Java +Connected to the target VM +threeCoroutines.kt:10 +"coroutine#1", state: RUNNING +"coroutine#2", state: RUNNING +"coroutine#3", state: RUNNING +Disconnected from the target VM + +Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/coroutines/twoDumps.kt b/idea/jvm-debugger/jvm-debugger-test/testData/coroutines/twoDumps.kt new file mode 100644 index 00000000000..133e6c9b5c2 --- /dev/null +++ b/idea/jvm-debugger/jvm-debugger-test/testData/coroutines/twoDumps.kt @@ -0,0 +1,31 @@ +package twoDumps + +suspend fun main() { + foo() + sequence { + foo() + yield(666) + }.toList() +} + +suspend fun foo() { + val f = 239 + bar() +} + +suspend fun bar() { + var r = 1337 + //Breakpoint! + r += 42 +} + +suspend fun SequenceScope.foo() { + val k = 228 + bar() +} + +suspend fun SequenceScope.bar() { + var r = 1337 + //Breakpoint! + r += 42 +} \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/coroutines/twoDumps.out b/idea/jvm-debugger/jvm-debugger-test/testData/coroutines/twoDumps.out new file mode 100644 index 00000000000..88a1c7d28d6 --- /dev/null +++ b/idea/jvm-debugger/jvm-debugger-test/testData/coroutines/twoDumps.out @@ -0,0 +1,12 @@ +LineBreakpoint created at twoDumps.kt:19 +LineBreakpoint created at twoDumps.kt:30 +Run Java +Connected to the target VM +twoDumps.kt:19 +"coroutine#1", state: RUNNING +twoDumps.kt:30 +"coroutine#1", state: RUNNING +"coroutine#2", state: RUNNING +Disconnected from the target VM + +Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/frameLambdaNotAccessible.kt b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/frameLambdaNotAccessible.kt new file mode 100644 index 00000000000..81f90d339e7 --- /dev/null +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/frameLambdaNotAccessible.kt @@ -0,0 +1,20 @@ +package frameLambdaNotAccessible + +fun main() { + val k = "lorem" + bar()() +} + +fun bar(): () -> Unit { + val k = "ipsum" + return { + val l = "doloret" + //Breakpoint! + Unit + } +} + +// PRINT_FRAME + +// EXPRESSION: k +// RESULT: 'k' is not captured \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/frameLambdaNotAccessible.out b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/frameLambdaNotAccessible.out new file mode 100644 index 00000000000..3abbf4d0073 --- /dev/null +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/frameLambdaNotAccessible.out @@ -0,0 +1,21 @@ +LineBreakpoint created at frameLambdaNotAccessible.kt:13 +Run Java +Connected to the target VM +frameLambdaNotAccessible.kt:13 +Compile bytecode for k + frame = invoke:13, FrameLambdaNotAccessibleKt$bar$1 {frameLambdaNotAccessible} + this = this = {frameLambdaNotAccessible.FrameLambdaNotAccessibleKt$bar$1@uniqueID}Function0 + field = arity: int = 0 (sp = Lambda.!EXT!) + local = l: java.lang.String = doloret (sp = frameLambdaNotAccessible.kt, 11) + field = value: char[] = {char[7]@uniqueID} (sp = String.!EXT!) + element = 0 = 'd' 100 + element = 1 = 'o' 111 + element = 2 = 'l' 108 + element = 3 = 'o' 111 + element = 4 = 'r' 114 + element = 5 = 'e' 101 + element = 6 = 't' 116 + field = hash: int = 0 (sp = String.!EXT!) +Disconnected from the target VM + +Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/frameLambdaVariableFromCorrectFrame.kt b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/frameLambdaVariableFromCorrectFrame.kt new file mode 100644 index 00000000000..a49d1e60d49 --- /dev/null +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/frameLambdaVariableFromCorrectFrame.kt @@ -0,0 +1,27 @@ +package frameLambdaVariableFromCorrectFrame + +fun main() { + val k = "lorem" + foo { + val j = "ipsum" + { + val l = 5 + //Breakpoint! + Unit + }() + } +} + +fun foo(block: () -> Any?) { + val k = "doloret" + val j = "sit" + block() +} + +// PRINT_FRAME + +// EXPRESSION: k +// RESULT: "lorem": Ljava/lang/String; + +// EXPRESSION: j +// RESULT: "ipsum": Ljava/lang/String; \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/frameLambdaVariableFromCorrectFrame.out b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/frameLambdaVariableFromCorrectFrame.out new file mode 100644 index 00000000000..92894149c09 --- /dev/null +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/frameLambdaVariableFromCorrectFrame.out @@ -0,0 +1,13 @@ +LineBreakpoint created at frameLambdaVariableFromCorrectFrame.kt:10 +Run Java +Connected to the target VM +frameLambdaVariableFromCorrectFrame.kt:10 +Compile bytecode for k +Compile bytecode for j + frame = invoke:10, FrameLambdaVariableFromCorrectFrameKt$main$1$1 {frameLambdaVariableFromCorrectFrame} + this = this = {frameLambdaVariableFromCorrectFrame.FrameLambdaVariableFromCorrectFrameKt$main$1$1@uniqueID}Function0 + field = arity: int = 0 (sp = Lambda.!EXT!) + local = l: int = 5 (sp = frameLambdaVariableFromCorrectFrame.kt, 8) +Disconnected from the target VM + +Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/nonCapturedThisInLambda.kt b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/nonCapturedThisInLambda.kt new file mode 100644 index 00000000000..229dc4890dc --- /dev/null +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/nonCapturedThisInLambda.kt @@ -0,0 +1,28 @@ +package nonCapturedThisInLambda + +fun main() { + Foo().bar() +} + +class Foo { + val a = "lorem" + val b: String + get() = "ipsum" + fun bar() { + { + //Breakpoint! + Unit + }() + } +} + +// PRINT_FRAME + +// EXPRESSION: a +// RESULT: "lorem": Ljava/lang/String; + +// EXPRESSION: b +// RESULT: "ipsum": Ljava/lang/String; + +// EXPRESSION: this +// RESULT: instance of nonCapturedThisInLambda.Foo(id=ID): LnonCapturedThisInLambda/Foo; \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/nonCapturedThisInLambda.out b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/nonCapturedThisInLambda.out new file mode 100644 index 00000000000..8c7d5bcdbf6 --- /dev/null +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/nonCapturedThisInLambda.out @@ -0,0 +1,13 @@ +LineBreakpoint created at nonCapturedThisInLambda.kt:14 +Run Java +Connected to the target VM +nonCapturedThisInLambda.kt:14 +Compile bytecode for a +Compile bytecode for b +Compile bytecode for this + frame = invoke:14, Foo$bar$1 {nonCapturedThisInLambda} + this = this = {nonCapturedThisInLambda.Foo$bar$1@uniqueID}Function0 + field = arity: int = 0 (sp = Lambda.!EXT!) +Disconnected from the target VM + +Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/kt32691.kt b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/kt32691.kt new file mode 100644 index 00000000000..d1f83e09481 --- /dev/null +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/kt32691.kt @@ -0,0 +1,24 @@ +package kt32691 + +fun main() { + //Breakpoint! + Unit +} + +class L + +// EXPRESSION: {}.toString() +// RESULT: "kotlin.jvm.functions.Function0": Ljava/lang/String; + +// EXPRESSION: {i: Int -> }.toString() +// RESULT: "kotlin.jvm.functions.Function1": Ljava/lang/String; + +// EXPRESSION: {i: Int, d: Double -> "239" }.toString() +// RESULT: "kotlin.jvm.functions.Function2": Ljava/lang/String; + +// EXPRESSION: {m : L -> ""}.toString() +// RESULT: "kotlin.jvm.functions.Function1, java.lang.String>": Ljava/lang/String; + + + + diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/kt32691.out b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/kt32691.out new file mode 100644 index 00000000000..5914ea8ba3a --- /dev/null +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/kt32691.out @@ -0,0 +1,11 @@ +LineBreakpoint created at kt32691.kt:5 +Run Java +Connected to the target VM +kt32691.kt:5 +Compile bytecode for {}.toString() +Compile bytecode for {i: Int -> }.toString() +Compile bytecode for {i: Int, d: Double -> "239" }.toString() +Compile bytecode for {m : L -> ""}.toString() +Disconnected from the target VM + +Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/kt33093.kt b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/kt33093.kt new file mode 100644 index 00000000000..694755b5e14 --- /dev/null +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/kt33093.kt @@ -0,0 +1,24 @@ +package kt33093 + +typealias foo = Nothing +typealias bar = foo + +fun main() { + //Breakpoint! + Unit +} + +// EXPRESSION: Nothing() +// RESULT: Type 'Nothing' can't be instantiated + +// EXPRESSION: foo() +// RESULT: Type 'Nothing' can't be instantiated + +// EXPRESSION: bar() +// RESULT: Type 'Nothing' can't be instantiated + +// EXPRESSION: { Nothing() } +// RESULT: Type 'Nothing' can't be instantiated + +// EXPRESSION: { bar() } +// RESULT: Type 'Nothing' can't be instantiated \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/kt33093.out b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/kt33093.out new file mode 100644 index 00000000000..4be507fbbc2 --- /dev/null +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/kt33093.out @@ -0,0 +1,8 @@ +LineBreakpoint created at statements.kt:5 +Run Java +Connected to the target VM +statements.kt:5 +Compile bytecode for val b = 1 +Disconnected from the target VM + +Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/kt33181.kt b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/kt33181.kt new file mode 100644 index 00000000000..a945daa0f46 --- /dev/null +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/kt33181.kt @@ -0,0 +1,33 @@ +package kt33181 + +fun main() { + Bar().foo() +} + +open class Foo { + open fun foo(): Int { + return 5 + } +} + +class Bar : Foo() { + override fun foo(): Int { + //Breakpoint! + return 6 + } +} + +// EXPRESSION: super.foo() +// RESULT: 5: I + +// EXPRESSION: for (i in 1..1) { super.foo()} +// RESULT: VOID_VALUE + +// EXPRESSION: { super.foo() } +// RESULT: Evaluation of 'super' calls inside lambdas and functions is not supported + +// EXPRESSION: fun() { super.foo() } +// RESULT: Evaluation of 'super' calls inside lambdas and functions is not supported + +// EXPRESSION: if(true) { fun named() { super.foo() } } // hack to avoid "Anonymous functions with names are prohibited" +// RESULT: Evaluation of 'super' calls inside lambdas and functions is not supported \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/kt33181.out b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/kt33181.out new file mode 100644 index 00000000000..58d044ffd29 --- /dev/null +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/kt33181.out @@ -0,0 +1,9 @@ +LineBreakpoint created at kt33181.kt:16 +Run Java +Connected to the target VM +kt33181.kt:16 +Compile bytecode for super.foo() +Compile bytecode for for (i in 1..1) { super.foo()} +Disconnected from the target VM + +Process finished with exit code 0