Generate correct linenumber for the debugger to see the return value
of suspend function. #KT-20322 Fixed
This commit is contained in:
Vendored
+32
@@ -0,0 +1,32 @@
|
||||
package anyUpdateInvokeStatic
|
||||
|
||||
import kotlin.sequences.*
|
||||
import kotlin.coroutines.*
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(object : Continuation<Unit>{
|
||||
override val context: CoroutineContext
|
||||
get() = EmptyCoroutineContext
|
||||
|
||||
override fun resumeWith(result: Result<Unit>) {
|
||||
result.getOrThrow()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
object A {
|
||||
@JvmStatic var s: Any? = "aabb"
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
builder {
|
||||
A.s = strChanger(A.s)
|
||||
//Breakpoint!
|
||||
println(A.s) // (1)
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun strChanger(str: Any?): Any? = (str as String).filter { it !in "a" }
|
||||
|
||||
// EXPRESSION: A.s
|
||||
// RESULT: "bb": Ljava/lang/String;
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
LineBreakpoint created at anyUpdateInvokeStatic.kt:25
|
||||
Run Java
|
||||
Connected to the target VM
|
||||
anyUpdateInvokeStatic.kt:25
|
||||
Compile bytecode for A.s
|
||||
Disconnected from the target VM
|
||||
|
||||
Process finished with exit code 0
|
||||
bb
|
||||
Vendored
+29
@@ -0,0 +1,29 @@
|
||||
package anyUpdateVariable
|
||||
|
||||
import kotlin.sequences.*
|
||||
import kotlin.coroutines.*
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(object : Continuation<Unit>{
|
||||
override val context: CoroutineContext
|
||||
get() = EmptyCoroutineContext
|
||||
|
||||
override fun resumeWith(result: Result<Unit>) {
|
||||
result.getOrThrow()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
builder {
|
||||
var s:Any? = "aabb"
|
||||
s = strChanger(s)
|
||||
//Breakpoint!
|
||||
println(s) // (1)
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun strChanger(str: Any?): Any? = (str as String).filter { it !in "a" }
|
||||
|
||||
// EXPRESSION: s
|
||||
// RESULT: "bb": Ljava/lang/String;
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
LineBreakpoint created at anyUpdateVariable.kt:22
|
||||
Run Java
|
||||
Connected to the target VM
|
||||
anyUpdateVariable.kt:22
|
||||
Compile bytecode for s
|
||||
Disconnected from the target VM
|
||||
|
||||
Process finished with exit code 0
|
||||
bb
|
||||
Vendored
+32
@@ -0,0 +1,32 @@
|
||||
package stringUpdateInvokeStatic
|
||||
|
||||
import kotlin.sequences.*
|
||||
import kotlin.coroutines.*
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(object : Continuation<Unit>{
|
||||
override val context: CoroutineContext
|
||||
get() = EmptyCoroutineContext
|
||||
|
||||
override fun resumeWith(result: Result<Unit>) {
|
||||
result.getOrThrow()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
object A {
|
||||
@JvmStatic var s: String = "aabb"
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
builder {
|
||||
A.s = strChanger(A.s)
|
||||
//Breakpoint!
|
||||
println(A.s) // (1)
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun strChanger(str: String): String = str.filter { it !in "a" }
|
||||
|
||||
// EXPRESSION: A.s
|
||||
// RESULT: "bb": Ljava/lang/String;
|
||||
idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/coroutines/stringUpdateInvokeStatic.out
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
LineBreakpoint created at stringUpdateInvokeStatic.kt:25
|
||||
Run Java
|
||||
Connected to the target VM
|
||||
stringUpdateInvokeStatic.kt:25
|
||||
Compile bytecode for A.s
|
||||
Disconnected from the target VM
|
||||
|
||||
Process finished with exit code 0
|
||||
bb
|
||||
idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/coroutines/stringUpdateInvokeVirtual.kt
Vendored
+31
@@ -0,0 +1,31 @@
|
||||
package stringUpdateInvokeVirtual
|
||||
|
||||
import kotlin.sequences.*
|
||||
import kotlin.coroutines.*
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(object : Continuation<Unit>{
|
||||
override val context: CoroutineContext
|
||||
get() = EmptyCoroutineContext
|
||||
|
||||
override fun resumeWith(result: Result<Unit>) {
|
||||
result.getOrThrow()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
class A(var s: String)
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
builder {
|
||||
var a = A("aabb")
|
||||
a.s = strChanger(a.s)
|
||||
//Breakpoint!
|
||||
println(a.s) // (1)
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun strChanger(str: String): String = str.filter { it !in "a" }
|
||||
|
||||
// EXPRESSION: a.s
|
||||
// RESULT: "bb": Ljava/lang/String;
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
LineBreakpoint created at stringUpdateInvokeVirtual.kt:24
|
||||
Run Java
|
||||
Connected to the target VM
|
||||
stringUpdateInvokeVirtual.kt:24
|
||||
Compile bytecode for a.s
|
||||
Disconnected from the target VM
|
||||
|
||||
Process finished with exit code 0
|
||||
bb
|
||||
Vendored
+31
@@ -0,0 +1,31 @@
|
||||
package stringUpdatePutField
|
||||
|
||||
import kotlin.sequences.*
|
||||
import kotlin.coroutines.*
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(object : Continuation<Unit>{
|
||||
override val context: CoroutineContext
|
||||
get() = EmptyCoroutineContext
|
||||
|
||||
override fun resumeWith(result: Result<Unit>) {
|
||||
result.getOrThrow()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
class A(@JvmField var s: String)
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
builder {
|
||||
var a = A("aabb")
|
||||
a.s = strChanger(a.s)
|
||||
//Breakpoint!
|
||||
println(a.s) // (1)
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun strChanger(str: String): String = str.filter { it !in "a" }
|
||||
|
||||
// EXPRESSION: a.s
|
||||
// RESULT: "bb": Ljava/lang/String;
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
LineBreakpoint created at stringUpdatePutField.kt:24
|
||||
Run Java
|
||||
Connected to the target VM
|
||||
stringUpdatePutField.kt:24
|
||||
Compile bytecode for a.s
|
||||
Disconnected from the target VM
|
||||
|
||||
Process finished with exit code 0
|
||||
bb
|
||||
Vendored
+29
@@ -0,0 +1,29 @@
|
||||
package stringUpdateVariable
|
||||
|
||||
import kotlin.sequences.*
|
||||
import kotlin.coroutines.*
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(object : Continuation<Unit>{
|
||||
override val context: CoroutineContext
|
||||
get() = EmptyCoroutineContext
|
||||
|
||||
override fun resumeWith(result: Result<Unit>) {
|
||||
result.getOrThrow()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
builder {
|
||||
var s = "aabb"
|
||||
s = strChanger(s)
|
||||
//Breakpoint!
|
||||
println(s) // (1)
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun strChanger(str: String): String = str.filter { it !in "a" }
|
||||
|
||||
// EXPRESSION: s
|
||||
// RESULT: "bb": Ljava/lang/String;
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
LineBreakpoint created at stringUpdateVariable.kt:22
|
||||
Run Java
|
||||
Connected to the target VM
|
||||
stringUpdateVariable.kt:22
|
||||
Compile bytecode for s
|
||||
Disconnected from the target VM
|
||||
|
||||
Process finished with exit code 0
|
||||
bb
|
||||
Reference in New Issue
Block a user