Check that breakpoints work in suspend function without suspension points

This commit is contained in:
Nikolay Krasko
2017-01-23 15:40:19 +03:00
parent 1a3d333da1
commit 649ec9a73d
4 changed files with 48 additions and 0 deletions
@@ -0,0 +1,8 @@
LineBreakpoint created at stopInSuspendFunctionWithoutSuspendPoints.kt:11
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !OUTPUT_PATH!;!KOTLIN_RUNTIME!;!CUSTOM_LIBRARY!;!RT_JAR! stopInSuspendFunctionWithoutSuspendPoints.StopInSuspendFunctionWithoutSuspendPointsKt
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
stopInSuspendFunctionWithoutSuspendPoints.kt:11
stopInSuspendFunctionWithoutSuspendPoints.kt:12
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
Process finished with exit code 0
@@ -0,0 +1,16 @@
package forTests
import kotlin.coroutines.Continuation
import kotlin.coroutines.CoroutineContext
import kotlin.coroutines.EmptyCoroutineContext
import kotlin.coroutines.startCoroutine
open class EmptyContinuation(override val context: CoroutineContext = EmptyCoroutineContext) : Continuation<Any?> {
companion object : EmptyContinuation()
override fun resume(data: Any?) {}
override fun resumeWithException(exception: Throwable) { throw exception }
}
fun builder(c: suspend () -> Unit) {
c.startCoroutine(EmptyContinuation)
}
@@ -0,0 +1,18 @@
package stopInSuspendFunctionWithoutSuspendPoints
import forTests.builder
fun foo(a: Any) {}
suspend fun first() {
foo("first")
//Breakpoint!
foo("second")
}
fun main(args: Array<String>) {
builder {
first()
}
}
@@ -818,6 +818,12 @@ public class KotlinSteppingTestGenerated extends AbstractKotlinSteppingTest {
doStepOverTest(fileName);
}
@TestMetadata("stopInSuspendFunctionWithoutSuspendPoints.kt")
public void testStopInSuspendFunctionWithoutSuspendPoints() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/debugger/tinyApp/src/stepping/stepOver/stopInSuspendFunctionWithoutSuspendPoints.kt");
doStepOverTest(fileName);
}
@TestMetadata("stopInlineCallInLocalFunInSecondaryConstructor.kt")
public void testStopInlineCallInLocalFunInSecondaryConstructor() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/debugger/tinyApp/src/stepping/stepOver/stopInlineCallInLocalFunInSecondaryConstructor.kt");