(CoroutineDebugger) Alternative CoroutineInfoProvider added

Added way to retrieve coroutine information without an agent
in target JVM. 'kotlin.debugger.coroutines.switch' provides
two possibilities to test coroutines.
Agent way gets activated once kotlinx.coroutines.debug.DebugProbes
started with javaagent.
Library-less ways use DispatchedContinuation or ChildContinuationImpl
classes to retrieve coroutine information and stack traces.
This commit is contained in:
Vladimir Ilmov
2020-03-17 09:40:28 +01:00
parent ac6036f366
commit cd12226f20
48 changed files with 1902 additions and 1094 deletions
@@ -6,6 +6,7 @@
package org.jetbrains.kotlin.idea.debugger.test
import com.intellij.debugger.engine.AsyncStackTraceProvider
import com.intellij.debugger.engine.JavaStackFrame
import com.intellij.debugger.engine.JavaValue
import com.intellij.debugger.memory.utils.StackFrameItem
import com.intellij.execution.process.ProcessOutputTypes
@@ -37,7 +38,7 @@ abstract class AbstractAsyncStackTraceTest : KotlinDescriptorTestCaseWithSteppin
val frameProxy = this.frameProxy
if (frameProxy != null) {
try {
val stackTrace = asyncStackTraceProvider.getAsyncStackTraceSafe(frameProxy, this)
val stackTrace = asyncStackTraceProvider.lookupForResumeContinuation(frameProxy, this)
if (stackTrace != null && stackTrace.isNotEmpty()) {
print(renderAsyncStackTrace(stackTrace), ProcessOutputTypes.SYSTEM)
} else {
@@ -52,7 +52,7 @@ abstract class AbstractCoroutineDumpTest : KotlinDescriptorTestCaseWithStepping(
private fun stringDump(infoData: List<CoroutineInfoData>) = buildString {
infoData.forEach {
appendln("\"${it.name}\", state: ${it.state}")
appendln("\"${it.key.name}\", state: ${it.key.state}")
}
}