• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2016-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3  */
4 
5 package kotlinx.coroutines.debug.internal
6 
7 import kotlin.coroutines.*
8 import kotlin.coroutines.jvm.internal.*
9 
10 /**
11  * This class represents the data required by IDEA debugger.
12  * IDEA debugger either directly reads data from the corresponding JVM fields of this class or calls the getters,
13  * so we keep both for maximal flexibility for now.
14  * **DO NOT MAKE BINARY-INCOMPATIBLE CHANGES TO THIS CLASS**.
15  */
16 @Suppress("unused")
17 @PublishedApi
18 internal class DebugCoroutineInfo internal constructor(
19     source: DebugCoroutineInfoImpl,
20     public val context: CoroutineContext // field is used as of 1.4-M3
21 ) {
22     internal val creationStackBottom: CoroutineStackFrame? = source.creationStackBottom // field is used as of 1.4-M3
23     public val sequenceNumber: Long = source.sequenceNumber // field is used as of 1.4-M3
24     public val creationStackTrace = source.creationStackTrace // getter is used as of 1.4-M3
25     public val state: String = source.state // getter is used as of 1.4-M3
26     public val lastObservedThread: Thread? = source.lastObservedThread // field is used as of 1.4-M3
27     public val lastObservedFrame: CoroutineStackFrame? = source.lastObservedFrame // field is used as of 1.4-M3
28     @get:JvmName("lastObservedStackTrace") // method with this name is used as of 1.4-M3
29     public val lastObservedStackTrace: List<StackTraceElement> = source.lastObservedStackTrace()
30 }
31