From 55ea0840b1f619a9cd38294f374427f5ab9bbda8 Mon Sep 17 00:00:00 2001 From: Yan Zhulanow Date: Tue, 9 Jul 2019 22:10:10 +0900 Subject: [PATCH] Debugger: Keep continuation and spilled variables until the whole trace is processed (EA-208000) --- .../idea/debugger/KotlinCoroutinesAsyncStackTraceProvider.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/idea/jvm-debugger/jvm-debugger-core/src/org/jetbrains/kotlin/idea/debugger/KotlinCoroutinesAsyncStackTraceProvider.kt b/idea/jvm-debugger/jvm-debugger-core/src/org/jetbrains/kotlin/idea/debugger/KotlinCoroutinesAsyncStackTraceProvider.kt index d820d73c351..f7cdd2e178f 100644 --- a/idea/jvm-debugger/jvm-debugger-core/src/org/jetbrains/kotlin/idea/debugger/KotlinCoroutinesAsyncStackTraceProvider.kt +++ b/idea/jvm-debugger/jvm-debugger-core/src/org/jetbrains/kotlin/idea/debugger/KotlinCoroutinesAsyncStackTraceProvider.kt @@ -97,6 +97,7 @@ class KotlinCoroutinesAsyncStackTraceProvider : KotlinCoroutinesAsyncStackTraceP val frameProxy = context.frameProxy val continuationVariable = frameProxy.safeVisibleVariableByName(CONTINUATION_VARIABLE_NAME) ?: return null val continuation = frameProxy.getValue(continuationVariable) as? ObjectReference ?: return null + context.keepReference(continuation) return collectFrames(continuation) } @@ -161,6 +162,8 @@ class KotlinCoroutinesAsyncStackTraceProvider : KotlinCoroutinesAsyncStackTraceP val rawSpilledVariables = context.invokeMethod(debugMetadataKtType, getSpilledVariableFieldMappingMethod, args) as? ArrayReference ?: return null + context.keepReference(rawSpilledVariables) + val length = rawSpilledVariables.length() / 2 val spilledVariables = ArrayList(length)