From 57214aa45319fa121378e1b3a69c85dfc71e2fc5 Mon Sep 17 00:00:00 2001 From: Vladimir Ilmov Date: Thu, 23 Apr 2020 11:11:26 +0200 Subject: [PATCH] (CoroutineDebugger) Exception if no creationStackTrace available #KT-38484 Fixed --- .../debugger/coroutine/proxy/CoroutineLibraryAgent2Proxy.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/idea/jvm-debugger/jvm-debugger-coroutine/src/org/jetbrains/kotlin/idea/debugger/coroutine/proxy/CoroutineLibraryAgent2Proxy.kt b/idea/jvm-debugger/jvm-debugger-coroutine/src/org/jetbrains/kotlin/idea/debugger/coroutine/proxy/CoroutineLibraryAgent2Proxy.kt index a7f23dd5edf..173ac5380ae 100644 --- a/idea/jvm-debugger/jvm-debugger-coroutine/src/org/jetbrains/kotlin/idea/debugger/coroutine/proxy/CoroutineLibraryAgent2Proxy.kt +++ b/idea/jvm-debugger/jvm-debugger-coroutine/src/org/jetbrains/kotlin/idea/debugger/coroutine/proxy/CoroutineLibraryAgent2Proxy.kt @@ -60,7 +60,11 @@ class CoroutineLibraryAgent2Proxy(private val executionContext: DefaultExecution variables: List ): CoroutineStackFrames { val index = frames.indexOfFirst { it.isCreationSeparatorFrame() } - val restoredStackFrames = frames.take(index).map { + val restoredStackTraceElements = if (index >= 0) + frames.take(index) + else + frames + val restoredStackFrames = restoredStackTraceElements.map { SuspendCoroutineStackFrameItem(it, locationCache.createLocation(it), variables) } val creationStackFrames = frames.subList(index + 1, frames.size).mapIndexed { ix, it ->