Check that breakpoints work in suspend function without suspension points
This commit is contained in:
+8
@@ -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)
|
||||
}
|
||||
Vendored
+18
@@ -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()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user