File tree 3 files changed +16
-7
lines changed
kotlinx-coroutines-core/jvm/src/debug/internal
kotlinx-coroutines-debug/test
3 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -107,6 +107,10 @@ internal object DebugProbesImpl {
107
107
.toList()
108
108
}
109
109
110
+ /*
111
+ * Internal (JVM-public) method used by IDEA debugger.
112
+ * It is equivalent to dumpCoroutines, but returns serializable (and thus less typed) objects.
113
+ */
110
114
public fun dumpDebuggerInfo () = dumpCoroutinesInfo().map { DebuggerInfo (it) }
111
115
112
116
public fun dumpCoroutines (out : PrintStream ): Unit = synchronized(out ) {
Original file line number Diff line number Diff line change 2
2
* Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3
3
*/
4
4
5
- @file:Suppress(" PropertyName " , " NO_EXPLICIT_VISIBILITY_IN_API_MODE " )
5
+ @file:Suppress(" UNUSED " )
6
6
7
7
package kotlinx.coroutines.debug.internal
8
8
9
9
import java.io.Serializable
10
10
import kotlin.coroutines.*
11
- import kotlin .coroutines.jvm.internal .*
11
+ import kotlinx .coroutines.*
12
12
13
+ /*
14
+ * This class represents all the data required by IDEA debugger.
15
+ * It is serializable in order to speedup JDWP interactions
16
+ */
13
17
internal class DebuggerInfo (source : DebugCoroutineInfo ) : Serializable {
14
- public val name: String? = source.context[kotlinx.coroutines.CoroutineName ]?.name
18
+ public val coroutineId: Long? = source.context[CoroutineId ]?.id
19
+ public val dispatcher: String? = source.context[ContinuationInterceptor ].toString()
20
+ public val name: String? = source.context[CoroutineName ]?.name
15
21
public val state: String = source.state
16
- public val lastObservedThreadState = source.lastObservedThread?.state
22
+ public val lastObservedThreadState: String? = source.lastObservedThread?.state?.toString()
17
23
public val lastObservedThreadName = source.lastObservedThread?.name
18
- public val lastObservedStackTrace = source.lastObservedStackTrace()
19
- public val sequenceNumber = source.sequenceNumber
24
+ public val lastObservedStackTrace: List < StackTraceElement > = source.lastObservedStackTrace()
25
+ public val sequenceNumber: Long = source.sequenceNumber
20
26
}
Original file line number Diff line number Diff line change @@ -179,7 +179,6 @@ class RunningThreadStackMergeTest : DebugTestBase() {
179
179
awaitCoroutineStarted()
180
180
val info = DebugProbesImpl .dumpDebuggerInfo().find { it.state == " RUNNING" }
181
181
assertNotNull(info)
182
- @Suppress(" INVISIBLE_MEMBER" ) // IDEA bug
183
182
assertNotNull(info.lastObservedThreadName)
184
183
coroutineBlocker.await()
185
184
}
You can’t perform that action at this time.
0 commit comments