Debugger: Display async stack trace elements for suspend callers (KT-28728)

This commit is contained in:
Yan Zhulanow
2018-12-10 16:32:19 +09:00
parent e8c066605b
commit f6b2e673f7
15 changed files with 681 additions and 20 deletions
@@ -0,0 +1,24 @@
package asyncFunctions
suspend fun main() {
val a = 5
val b = 7
none()
foo()
}
suspend fun foo() {
val x = "foo"
none()
bar()
}
suspend fun bar() {
var y = "zoo"
none()
val z = "bar"
//Breakpoint!
val a = 5
}
suspend fun none() {}
@@ -0,0 +1,15 @@
LineBreakpoint created at asyncFunctions.kt:21
Run Java
Connected to the target VM
asyncFunctions.kt:21
Async stack trace:
asyncFunctions.AsyncFunctionsKt:18
y = "zoo"
asyncFunctions.AsyncFunctionsKt:13
x = "foo"
asyncFunctions.AsyncFunctionsKt:7
a = 5
b = 7
Disconnected from the target VM
Process finished with exit code 0
@@ -0,0 +1,20 @@
package asyncLambdas
suspend fun main() {
foo()
}
val foo: suspend () -> Unit = {
val a = 5
bar()
}
val bar: suspend () -> Unit = {
val b = 3
baz()
}
val baz: suspend () -> Unit = {
//Breakpoint!
val a = 5
}
@@ -0,0 +1,12 @@
LineBreakpoint created at asyncLambdas.kt:19
Run Java
Connected to the target VM
asyncLambdas.kt:19
Async stack trace:
asyncLambdas.AsyncLambdasKt$bar$1:14
b = 3
asyncLambdas.AsyncLambdasKt$foo$1:9
a = 5
Disconnected from the target VM
Process finished with exit code 0
@@ -0,0 +1,10 @@
package asyncSimple
suspend fun main() {
val a = 5
foo()
//Breakpoint!
val b = a
}
suspend fun foo() {}
@@ -0,0 +1,10 @@
LineBreakpoint created at asyncSimple.kt:7
Run Java
Connected to the target VM
asyncSimple.kt:7
Async stack trace:
asyncSimple.AsyncSimpleKt:5
a = 5
Disconnected from the target VM
Process finished with exit code 0