coroutine debugger logic moved to jvm-debugger-coroutine module

This commit is contained in:
Vladimir Ilmov
2020-01-08 11:53:50 +01:00
committed by Vladimir Ilmov
parent b1b0817336
commit e570450c59
37 changed files with 129 additions and 107 deletions
+1
View File
@@ -75,6 +75,7 @@ dependencies {
compile(project(":idea:jvm-debugger:jvm-debugger-core"))
compile(project(":idea:jvm-debugger:jvm-debugger-evaluation"))
compile(project(":idea:jvm-debugger:jvm-debugger-sequence"))
compile(project(":idea:jvm-debugger:jvm-debugger-coroutine"))
compile(project(":j2k"))
compile(project(":idea:idea-j2k"))
compile(project(":idea:formatter"))
@@ -0,0 +1,22 @@
plugins {
kotlin("jvm")
id("jps-compatible")
}
dependencies {
compile(project(":idea:jvm-debugger:jvm-debugger-core"))
compileOnly(intellijDep())
Platform[192].orHigher {
compileOnly(intellijPluginDep("java"))
}
testCompile(project(":kotlin-test:kotlin-test-junit"))
testCompile(commonDep("junit:junit"))
}
sourceSets {
"main" { projectDefault() }
"test" { none() }
}
@@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.debugger.coroutines
package org.jetbrains.kotlin.idea.debugger.coroutine
import com.intellij.debugger.engine.*
import com.intellij.debugger.engine.evaluation.EvaluationContextImpl
@@ -11,8 +11,8 @@ import com.intellij.debugger.jdi.StackFrameProxyImpl
import com.intellij.xdebugger.frame.XSuspendContext
import com.sun.jdi.*
import org.jetbrains.kotlin.idea.debugger.*
import org.jetbrains.kotlin.idea.debugger.coroutines.data.CoroutineAsyncStackFrameItem
import org.jetbrains.kotlin.idea.debugger.coroutines.proxy.AsyncStackTraceContext
import org.jetbrains.kotlin.idea.debugger.coroutine.data.CoroutineAsyncStackFrameItem
import org.jetbrains.kotlin.idea.debugger.coroutine.proxy.AsyncStackTraceContext
import org.jetbrains.kotlin.idea.debugger.evaluate.ExecutionContext
class CoroutineAsyncStackTraceProvider : AsyncStackTraceProvider {
@@ -2,7 +2,7 @@
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.debugger.coroutines
package org.jetbrains.kotlin.idea.debugger.coroutine
import com.intellij.execution.RunConfigurationExtension
import com.intellij.execution.configurations.DebuggingRunnerData
@@ -14,7 +14,7 @@ import com.intellij.execution.configurations.RunnerSettings
* Installs coroutines debug agent and coroutines tab if `kotlinx-coroutines-debug` dependency is found
*/
@Suppress("IncompatibleAPI")
class CoroutinesDebugConfigurationExtension : RunConfigurationExtension() {
class CoroutineDebugConfigurationExtension : RunConfigurationExtension() {
override fun isApplicableFor(configuration: RunConfigurationBase<*>) = coroutineDebuggerEnabled()
@@ -2,7 +2,7 @@
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.debugger.coroutines
package org.jetbrains.kotlin.idea.debugger.coroutine
import com.intellij.execution.RunConfigurationExtension
import com.intellij.execution.configurations.DebuggingRunnerData
@@ -14,7 +14,7 @@ import com.intellij.execution.configurations.RunnerSettings
* Installs coroutines debug agent and coroutines tab if `kotlinx-coroutines-debug` dependency is found
*/
@Suppress("IncompatibleAPI")
class CoroutinesDebugConfigurationExtension : RunConfigurationExtension() {
class CoroutineDebugConfigurationExtension : RunConfigurationExtension() {
override fun isApplicableFor(configuration: RunConfigurationBase<*>) = coroutineDebuggerEnabled()
@@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.debugger.coroutines
package org.jetbrains.kotlin.idea.debugger.coroutine
import org.jetbrains.annotations.NonNls
@@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.debugger.coroutines
package org.jetbrains.kotlin.idea.debugger.coroutine
import com.intellij.debugger.DebuggerInvocationUtil
import com.intellij.debugger.actions.ThreadDumpAction
@@ -31,9 +31,9 @@ import com.intellij.util.messages.MessageBusConnection
import com.intellij.xdebugger.*
import com.intellij.xdebugger.impl.XDebugSessionImpl
import org.jetbrains.kotlin.idea.KotlinBundle
import org.jetbrains.kotlin.idea.debugger.coroutines.util.*
import org.jetbrains.kotlin.idea.debugger.coroutines.view.CoroutinesPanel
import org.jetbrains.kotlin.idea.debugger.coroutines.view.XCoroutineView
import org.jetbrains.kotlin.idea.debugger.coroutine.util.*
import org.jetbrains.kotlin.idea.debugger.coroutine.view.CoroutinesPanel
import org.jetbrains.kotlin.idea.debugger.coroutine.view.XCoroutineView
import java.util.concurrent.atomic.AtomicInteger
import kotlin.properties.ReadOnlyProperty
import kotlin.reflect.KProperty
@@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.debugger.coroutines.command
package org.jetbrains.kotlin.idea.debugger.coroutine.command
import com.intellij.debugger.DebuggerInvocationUtil
import com.intellij.debugger.engine.events.DebuggerContextCommandImpl
@@ -3,13 +3,13 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.debugger.coroutines.command
package org.jetbrains.kotlin.idea.debugger.coroutine.command
import com.intellij.debugger.impl.DebuggerContextImpl
import com.intellij.debugger.ui.impl.watch.DebuggerTreeNodeImpl
import com.intellij.debugger.ui.impl.watch.NodeManagerImpl
import org.jetbrains.kotlin.idea.debugger.coroutines.data.CreationFramesDescriptor
import org.jetbrains.kotlin.idea.debugger.coroutines.data.CoroutineCreatedStackFrameDescriptor
import org.jetbrains.kotlin.idea.debugger.coroutine.data.CreationFramesDescriptor
import org.jetbrains.kotlin.idea.debugger.coroutine.data.CoroutineCreatedStackFrameDescriptor
@Deprecated("moved to XCoroutineView")
class CoroutineBuildCreationFrameCommand(
@@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.debugger.coroutines.command
package org.jetbrains.kotlin.idea.debugger.coroutine.command
import com.intellij.debugger.engine.DebugProcessImpl
import com.intellij.debugger.engine.JavaStackFrame
@@ -14,8 +14,8 @@ import com.intellij.debugger.jdi.StackFrameProxyImpl
import com.intellij.debugger.jdi.ThreadReferenceProxyImpl
import com.intellij.debugger.memory.utils.StackFrameItem
import com.intellij.debugger.ui.impl.watch.*
import org.jetbrains.kotlin.idea.debugger.coroutines.CoroutineAsyncStackTraceProvider
import org.jetbrains.kotlin.idea.debugger.coroutines.data.*
import org.jetbrains.kotlin.idea.debugger.coroutine.CoroutineAsyncStackTraceProvider
import org.jetbrains.kotlin.idea.debugger.coroutine.data.*
@Deprecated("Moved to XCoroutineView")
class CoroutineBuildFrameCommand(
@@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.debugger.coroutines.command
package org.jetbrains.kotlin.idea.debugger.coroutine.command
import com.intellij.debugger.DebuggerManagerEx
import com.intellij.debugger.engine.*
@@ -22,13 +22,13 @@ import com.intellij.xdebugger.frame.XStackFrame
import com.intellij.xdebugger.frame.XSuspendContext
import com.sun.jdi.*
import org.jetbrains.kotlin.idea.debugger.*
import org.jetbrains.kotlin.idea.debugger.coroutines.CoroutineAsyncStackTraceProvider
import org.jetbrains.kotlin.idea.debugger.coroutines.data.CoroutineInfoData
import org.jetbrains.kotlin.idea.debugger.coroutines.data.SuspendStackFrameDescriptor
import org.jetbrains.kotlin.idea.debugger.coroutines.data.SyntheticStackFrame
import org.jetbrains.kotlin.idea.debugger.coroutines.proxy.AsyncStackTraceContext
import org.jetbrains.kotlin.idea.debugger.coroutines.util.EmptyStackFrameDescriptor
import org.jetbrains.kotlin.idea.debugger.coroutines.util.logger
import org.jetbrains.kotlin.idea.debugger.coroutine.CoroutineAsyncStackTraceProvider
import org.jetbrains.kotlin.idea.debugger.coroutine.data.CoroutineInfoData
import org.jetbrains.kotlin.idea.debugger.coroutine.data.SuspendStackFrameDescriptor
import org.jetbrains.kotlin.idea.debugger.coroutine.data.SyntheticStackFrame
import org.jetbrains.kotlin.idea.debugger.coroutine.proxy.AsyncStackTraceContext
import org.jetbrains.kotlin.idea.debugger.coroutine.util.EmptyStackFrameDescriptor
import org.jetbrains.kotlin.idea.debugger.coroutine.util.logger
import org.jetbrains.kotlin.idea.debugger.evaluate.ExecutionContext
@@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.debugger.coroutines.command
package org.jetbrains.kotlin.idea.debugger.coroutine.command
import com.intellij.debugger.DebuggerManagerEx
import com.intellij.debugger.engine.events.SuspendContextCommandImpl
@@ -24,11 +24,10 @@ import com.intellij.psi.search.GlobalSearchScope
import com.intellij.util.text.DateFormatUtil
import com.intellij.xdebugger.impl.XDebuggerManagerImpl
import org.jetbrains.kotlin.idea.KotlinBundle
import org.jetbrains.kotlin.idea.debugger.coroutines.view.CoroutineDumpPanel
import org.jetbrains.kotlin.idea.debugger.coroutines.coroutineDebuggerEnabled
import org.jetbrains.kotlin.idea.debugger.coroutines.data.CoroutineInfoData
import org.jetbrains.kotlin.idea.debugger.coroutines.proxy.CoroutinesDebugProbesProxy
import org.jetbrains.kotlin.idea.debugger.coroutines.util.logger
import org.jetbrains.kotlin.idea.debugger.coroutine.view.CoroutineDumpPanel
import org.jetbrains.kotlin.idea.debugger.coroutine.coroutineDebuggerEnabled
import org.jetbrains.kotlin.idea.debugger.coroutine.data.CoroutineInfoData
import org.jetbrains.kotlin.idea.debugger.coroutine.proxy.CoroutineDebugProbesProxy
@Suppress("ComponentNotRegistered")
class CoroutineDumpAction : AnAction(), AnAction.TransparentUpdate {
@@ -41,7 +40,7 @@ class CoroutineDumpAction : AnAction(), AnAction.TransparentUpdate {
val process = context.debugProcess ?: return
process.managerThread.schedule(object : SuspendContextCommandImpl(context.suspendContext) {
override fun contextAction() {
val states = CoroutinesDebugProbesProxy(context.suspendContext ?: return)
val states = CoroutineDebugProbesProxy(context.suspendContext ?: return)
.dumpCoroutines()
if (states.isOk()) {
val message = KotlinBundle.message("debugger.session.tab.coroutine.message.error")
@@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.debugger.coroutines.command
package org.jetbrains.kotlin.idea.debugger.coroutine.command
import com.intellij.debugger.DebuggerInvocationUtil
import com.intellij.debugger.engine.SuspendContextImpl
@@ -14,11 +14,11 @@ import com.intellij.debugger.impl.DebuggerSession
import com.intellij.debugger.ui.impl.watch.DebuggerTreeNodeImpl
import com.intellij.debugger.ui.impl.watch.NodeManagerImpl
import org.jetbrains.kotlin.idea.KotlinBundle
import org.jetbrains.kotlin.idea.debugger.coroutines.data.CoroutineDescriptorData
import org.jetbrains.kotlin.idea.debugger.coroutines.data.CoroutineInfoData
import org.jetbrains.kotlin.idea.debugger.coroutines.proxy.CoroutinesDebugProbesProxy
import org.jetbrains.kotlin.idea.debugger.coroutines.util.ProjectNotification
import org.jetbrains.kotlin.idea.debugger.coroutines.view.CoroutinesDebuggerTree
import org.jetbrains.kotlin.idea.debugger.coroutine.data.CoroutineDescriptorData
import org.jetbrains.kotlin.idea.debugger.coroutine.data.CoroutineInfoData
import org.jetbrains.kotlin.idea.debugger.coroutine.proxy.CoroutineDebugProbesProxy
import org.jetbrains.kotlin.idea.debugger.coroutine.util.ProjectNotification
import org.jetbrains.kotlin.idea.debugger.coroutine.view.CoroutinesDebuggerTree
@Deprecated("moved to XCoroutineView")
class RefreshCoroutinesTreeCommand(
@@ -32,7 +32,7 @@ class RefreshCoroutinesTreeCommand(
val root = nodeManagerImpl.defaultNode
val suspendContext: SuspendContextImpl? = suspendContext
if (context.debuggerSession is DebuggerSession && suspendContext is SuspendContextImpl && !suspendContext.isResumed) {
var infoCache = CoroutinesDebugProbesProxy(suspendContext).dumpCoroutines()
var infoCache = CoroutineDebugProbesProxy(suspendContext).dumpCoroutines()
if (infoCache.isOk()) {
val evaluationContext = evaluationContext(suspendContext)
for (state in infoCache.cache) {
@@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.debugger.coroutines.data
package org.jetbrains.kotlin.idea.debugger.coroutine.data
import com.intellij.debugger.jdi.GeneratedLocation
import com.intellij.debugger.memory.utils.StackFrameItem
@@ -3,10 +3,10 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.debugger.coroutines.data
package org.jetbrains.kotlin.idea.debugger.coroutine.data
import com.sun.jdi.*
import org.jetbrains.kotlin.idea.debugger.coroutines.command.CoroutineStackFrameItem
import org.jetbrains.kotlin.idea.debugger.coroutine.command.CoroutineStackFrameItem
/**
* Represents state of a coroutine.
@@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.debugger.coroutines.data
package org.jetbrains.kotlin.idea.debugger.coroutine.data
import com.intellij.debugger.engine.JavaStackFrame
import com.intellij.debugger.ui.impl.watch.StackFrameDescriptorImpl
@@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.debugger.coroutines.data
package org.jetbrains.kotlin.idea.debugger.coroutine.data
import com.intellij.debugger.engine.evaluation.EvaluateException
import com.intellij.debugger.engine.evaluation.EvaluationContextImpl
@@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.debugger.coroutines.data
package org.jetbrains.kotlin.idea.debugger.coroutine.data
import com.intellij.debugger.engine.evaluation.EvaluationContextImpl
import com.intellij.debugger.impl.descriptors.data.DescriptorData
@@ -14,7 +14,7 @@ import com.intellij.debugger.memory.utils.StackFrameItem
import com.intellij.debugger.ui.impl.watch.NodeDescriptorImpl
import com.intellij.openapi.project.Project
import com.sun.jdi.*
import org.jetbrains.kotlin.idea.debugger.coroutines.proxy.LookupContinuation
import org.jetbrains.kotlin.idea.debugger.coroutine.proxy.LookupContinuation
import org.jetbrains.kotlin.idea.debugger.evaluate.ExecutionContext
@Deprecated("moved to XCoroutineView")
@@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.debugger.coroutines.proxy
package org.jetbrains.kotlin.idea.debugger.coroutine.proxy
import com.intellij.debugger.DebuggerContext
import com.intellij.debugger.engine.JavaValue
@@ -15,9 +15,9 @@ import com.intellij.xdebugger.frame.XNamedValue
import com.sun.jdi.*
import org.jetbrains.kotlin.codegen.coroutines.CONTINUATION_VARIABLE_NAME
import org.jetbrains.kotlin.idea.debugger.evaluate.ExecutionContext
import org.jetbrains.kotlin.idea.debugger.coroutines.util.logger
import org.jetbrains.kotlin.idea.debugger.coroutine.util.logger
import org.jetbrains.kotlin.idea.debugger.SUSPEND_LAMBDA_CLASSES
import org.jetbrains.kotlin.idea.debugger.coroutines.data.CoroutineAsyncStackFrameItem
import org.jetbrains.kotlin.idea.debugger.coroutine.data.CoroutineAsyncStackFrameItem
import org.jetbrains.kotlin.idea.debugger.isSubtype
import org.jetbrains.kotlin.idea.debugger.safeVisibleVariableByName
@@ -2,20 +2,20 @@
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.debugger.coroutines.proxy
package org.jetbrains.kotlin.idea.debugger.coroutine.proxy
import com.intellij.debugger.engine.SuspendContextImpl
import com.intellij.debugger.engine.evaluation.EvaluationContextImpl
import com.intellij.debugger.jdi.StackFrameProxyImpl
import com.intellij.xdebugger.frame.XSuspendContext
import com.sun.jdi.*
import org.jetbrains.kotlin.idea.debugger.coroutines.command.CoroutineBuilder
import org.jetbrains.kotlin.idea.debugger.coroutines.view.CoroutineInfoCache
import org.jetbrains.kotlin.idea.debugger.coroutines.data.CoroutineInfoData
import org.jetbrains.kotlin.idea.debugger.coroutines.util.logger
import org.jetbrains.kotlin.idea.debugger.coroutine.command.CoroutineBuilder
import org.jetbrains.kotlin.idea.debugger.coroutine.view.CoroutineInfoCache
import org.jetbrains.kotlin.idea.debugger.coroutine.data.CoroutineInfoData
import org.jetbrains.kotlin.idea.debugger.coroutine.util.logger
import org.jetbrains.kotlin.idea.debugger.evaluate.ExecutionContext
class CoroutinesDebugProbesProxy(val suspendContext: XSuspendContext) {
class CoroutineDebugProbesProxy(val suspendContext: XSuspendContext) {
private val log by logger
private var executionContext: ExecutionContext = executionContext()
@@ -3,10 +3,10 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.debugger.coroutines.proxy
package org.jetbrains.kotlin.idea.debugger.coroutine.proxy
import com.sun.jdi.*
import org.jetbrains.kotlin.idea.debugger.coroutines.data.CoroutineInfoData
import org.jetbrains.kotlin.idea.debugger.coroutine.data.CoroutineInfoData
import org.jetbrains.kotlin.idea.debugger.evaluate.ExecutionContext
import org.jetbrains.kotlin.idea.debugger.isSubtype
@@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.debugger.coroutines.proxy
package org.jetbrains.kotlin.idea.debugger.coroutine.proxy
import com.intellij.debugger.engine.DebugProcessImpl
import com.intellij.debugger.engine.SuspendContextImpl
@@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.debugger.coroutines.util
package org.jetbrains.kotlin.idea.debugger.coroutine.util
import com.intellij.debugger.jdi.StackFrameProxyImpl
import com.intellij.debugger.ui.impl.watch.MethodsTracker
@@ -15,7 +15,7 @@ import com.intellij.psi.search.GlobalSearchScope
import com.intellij.xdebugger.XDebuggerUtil
import com.intellij.xdebugger.XSourcePosition
import com.intellij.xdebugger.impl.XDebuggerManagerImpl
import org.jetbrains.kotlin.idea.debugger.coroutines.proxy.ApplicationThreadExecutor
import org.jetbrains.kotlin.idea.debugger.coroutine.proxy.ApplicationThreadExecutor
fun getPosition(stackTraceElement: StackTraceElement, project: Project): XSourcePosition? {
val psiFacade = JavaPsiFacade.getInstance(project)
@@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.debugger.coroutines.util
package org.jetbrains.kotlin.idea.debugger.coroutine.util
import com.intellij.openapi.diagnostic.Logger
import com.intellij.xdebugger.XDebugSession
@@ -3,9 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.debugger.coroutines.util;
import com.intellij.xdebugger.XSourcePosition;
package org.jetbrains.kotlin.idea.debugger.coroutine.util;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
@@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.debugger.coroutines.view
package org.jetbrains.kotlin.idea.debugger.coroutine.view
import com.intellij.codeInsight.highlighting.HighlightManager
import com.intellij.execution.ui.ConsoleView
@@ -32,7 +32,7 @@ import com.intellij.ui.components.JBList
import com.intellij.unscramble.AnalyzeStacktraceUtil
import com.intellij.util.PlatformIcons
import com.intellij.util.ui.EmptyIcon
import org.jetbrains.kotlin.idea.debugger.coroutines.data.CoroutineInfoData
import org.jetbrains.kotlin.idea.debugger.coroutine.data.CoroutineInfoData
import java.awt.BorderLayout
import java.awt.Color
import java.awt.datatransfer.StringSelection
@@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.debugger.coroutines.view
package org.jetbrains.kotlin.idea.debugger.coroutine.view
import com.intellij.debugger.engine.SuspendContextImpl
import com.intellij.openapi.application.ApplicationManager
@@ -12,7 +12,7 @@ import com.intellij.xdebugger.XDebugSessionListener
import com.intellij.xdebugger.frame.XSuspendContext
import com.intellij.xdebugger.impl.ui.DebuggerUIUtil
import com.sun.jdi.request.EventRequest
import org.jetbrains.kotlin.idea.debugger.coroutines.util.logger
import org.jetbrains.kotlin.idea.debugger.coroutine.util.logger
class CoroutineViewDebugSessionListener(
private val session: XDebugSession,
@@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.debugger.coroutines.view
package org.jetbrains.kotlin.idea.debugger.coroutine.view
import com.intellij.debugger.DebuggerBundle
import com.intellij.debugger.engine.events.DebuggerCommandImpl
@@ -15,14 +15,14 @@ import com.intellij.debugger.ui.impl.watch.*
import com.intellij.debugger.ui.tree.StackFrameDescriptor
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.project.Project
import org.jetbrains.kotlin.idea.debugger.coroutines.command.CoroutineBuildCreationFrameCommand
import org.jetbrains.kotlin.idea.debugger.coroutines.command.CoroutineBuildFrameCommand
import org.jetbrains.kotlin.idea.debugger.coroutines.command.RefreshCoroutinesTreeCommand
import org.jetbrains.kotlin.idea.debugger.coroutines.data.CoroutineDescriptorImpl
import org.jetbrains.kotlin.idea.debugger.coroutines.data.CoroutineInfoData
import org.jetbrains.kotlin.idea.debugger.coroutines.data.CreationFramesDescriptor
import org.jetbrains.kotlin.idea.debugger.coroutines.proxy.ManagerThreadExecutor
import org.jetbrains.kotlin.idea.debugger.coroutines.util.logger
import org.jetbrains.kotlin.idea.debugger.coroutine.command.CoroutineBuildCreationFrameCommand
import org.jetbrains.kotlin.idea.debugger.coroutine.command.CoroutineBuildFrameCommand
import org.jetbrains.kotlin.idea.debugger.coroutine.command.RefreshCoroutinesTreeCommand
import org.jetbrains.kotlin.idea.debugger.coroutine.data.CoroutineDescriptorImpl
import org.jetbrains.kotlin.idea.debugger.coroutine.data.CoroutineInfoData
import org.jetbrains.kotlin.idea.debugger.coroutine.data.CreationFramesDescriptor
import org.jetbrains.kotlin.idea.debugger.coroutine.proxy.ManagerThreadExecutor
import org.jetbrains.kotlin.idea.debugger.coroutine.util.logger
import java.util.*
/**
@@ -5,7 +5,7 @@
@file:Suppress("DEPRECATION")
package org.jetbrains.kotlin.idea.debugger.coroutines.view
package org.jetbrains.kotlin.idea.debugger.coroutine.view
import com.intellij.debugger.actions.DebuggerActions
import com.intellij.debugger.impl.DebuggerStateManager
@@ -13,7 +13,7 @@ import com.intellij.debugger.ui.impl.ThreadsPanel
import com.intellij.debugger.ui.impl.watch.DebuggerTree
import com.intellij.openapi.actionSystem.*
import com.intellij.openapi.project.Project
import org.jetbrains.kotlin.idea.debugger.coroutines.CoroutineDebuggerActions
import org.jetbrains.kotlin.idea.debugger.coroutine.CoroutineDebuggerActions
/**
* Added into ui in [CoroutineProjectConnectionListener.registerCoroutinesPanel]
@@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.debugger.coroutines.view
package org.jetbrains.kotlin.idea.debugger.coroutine.view
import com.intellij.debugger.impl.DebuggerUtilsEx
import com.intellij.debugger.settings.ThreadsViewSettings
@@ -19,7 +19,7 @@ import com.intellij.xdebugger.impl.ui.DebuggerUIUtil
import com.intellij.xdebugger.impl.ui.XDebuggerUIConstants
import com.sun.jdi.Location
import com.sun.jdi.ReferenceType
import org.jetbrains.kotlin.idea.debugger.coroutines.data.CoroutineInfoData
import org.jetbrains.kotlin.idea.debugger.coroutine.data.CoroutineInfoData
import javax.swing.Icon
class SimpleColoredTextIcon(val icon: Icon?, val hasChildrens: Boolean) {
@@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.debugger.coroutines.view
package org.jetbrains.kotlin.idea.debugger.coroutine.view
import com.intellij.debugger.DebuggerManagerEx
import com.intellij.debugger.engine.DebugProcessImpl
@@ -32,18 +32,18 @@ import com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl
import com.sun.jdi.ClassType
import javaslang.control.Either
import org.jetbrains.kotlin.idea.KotlinBundle
import org.jetbrains.kotlin.idea.debugger.coroutines.CoroutineAsyncStackTraceProvider
import org.jetbrains.kotlin.idea.debugger.coroutines.CoroutineDebuggerContentInfo
import org.jetbrains.kotlin.idea.debugger.coroutines.CoroutineDebuggerContentInfo.Companion.XCOROUTINE_POPUP_ACTION_GROUP
import org.jetbrains.kotlin.idea.debugger.coroutines.command.*
import org.jetbrains.kotlin.idea.debugger.coroutines.data.CoroutineInfoData
import org.jetbrains.kotlin.idea.debugger.coroutines.data.SuspendStackFrameDescriptor
import org.jetbrains.kotlin.idea.debugger.coroutines.data.SyntheticStackFrame
import org.jetbrains.kotlin.idea.debugger.coroutines.proxy.ApplicationThreadExecutor
import org.jetbrains.kotlin.idea.debugger.coroutines.proxy.AsyncStackTraceContext
import org.jetbrains.kotlin.idea.debugger.coroutines.proxy.CoroutinesDebugProbesProxy
import org.jetbrains.kotlin.idea.debugger.coroutines.proxy.ManagerThreadExecutor
import org.jetbrains.kotlin.idea.debugger.coroutines.util.*
import org.jetbrains.kotlin.idea.debugger.coroutine.CoroutineAsyncStackTraceProvider
import org.jetbrains.kotlin.idea.debugger.coroutine.CoroutineDebuggerContentInfo
import org.jetbrains.kotlin.idea.debugger.coroutine.CoroutineDebuggerContentInfo.Companion.XCOROUTINE_POPUP_ACTION_GROUP
import org.jetbrains.kotlin.idea.debugger.coroutine.command.*
import org.jetbrains.kotlin.idea.debugger.coroutine.data.CoroutineInfoData
import org.jetbrains.kotlin.idea.debugger.coroutine.data.SuspendStackFrameDescriptor
import org.jetbrains.kotlin.idea.debugger.coroutine.data.SyntheticStackFrame
import org.jetbrains.kotlin.idea.debugger.coroutine.proxy.ApplicationThreadExecutor
import org.jetbrains.kotlin.idea.debugger.coroutine.proxy.AsyncStackTraceContext
import org.jetbrains.kotlin.idea.debugger.coroutine.proxy.CoroutineDebugProbesProxy
import org.jetbrains.kotlin.idea.debugger.coroutine.proxy.ManagerThreadExecutor
import org.jetbrains.kotlin.idea.debugger.coroutine.util.*
import org.jetbrains.kotlin.idea.debugger.evaluate.ExecutionContext
import java.awt.event.KeyAdapter
import java.awt.event.KeyEvent
@@ -52,7 +52,6 @@ import java.awt.event.MouseEvent
class XCoroutineView(val project: Project, val session: XDebugSession) :
Disposable, XDebugSessionListenerProvider, CreateContentParamsProvider {
private var needToRestoreState: Boolean = false
val log by logger
val splitter = OnePixelSplitter("SomeKey", 0.25f)
val panel = XDebuggerTreePanel(project, session.debugProcess.editorsProvider, this, null, XCOROUTINE_POPUP_ACTION_GROUP, null)
@@ -139,7 +138,7 @@ class XCoroutineView(val project: Project, val session: XDebugSession) :
override fun computeChildren(node: XCompositeNode) {
managerThreadExecutor.on(suspendContext).schedule {
val debugProbesProxy = CoroutinesDebugProbesProxy(suspendContext)
val debugProbesProxy = CoroutineDebugProbesProxy(suspendContext)
var coroutineCache = debugProbesProxy.dumpCoroutines()
if (coroutineCache.isOk()) {
@@ -164,7 +163,7 @@ class XCoroutineView(val project: Project, val session: XDebugSession) :
override fun computeChildren(node: XCompositeNode) {
managerThreadExecutor.on(suspendContext).schedule {
val debugProbesProxy = CoroutinesDebugProbesProxy(suspendContext)
val debugProbesProxy = CoroutineDebugProbesProxy(suspendContext)
val children = XValueChildrenList()
debugProbesProxy.frameBuilder().build(infoData)
val creationStack = mutableListOf<CreationCoroutineStackFrameItem>()
@@ -9,6 +9,7 @@ dependencies {
testCompile(project(":idea:jvm-debugger:jvm-debugger-core"))
testCompile(project(":idea:jvm-debugger:jvm-debugger-evaluation"))
testCompile(project(":idea:jvm-debugger:jvm-debugger-sequence"))
testCompile(project(":idea:jvm-debugger:jvm-debugger-coroutine"))
testCompile(project(":compiler:backend"))
testCompile(files("${System.getProperty("java.home")}/../lib/tools.jar"))
testCompile(project(":kotlin-test:kotlin-test-junit"))
@@ -10,7 +10,7 @@ import com.intellij.debugger.engine.JavaValue
import com.intellij.debugger.memory.utils.StackFrameItem
import com.intellij.execution.process.ProcessOutputTypes
import com.intellij.openapi.extensions.Extensions
import org.jetbrains.kotlin.idea.debugger.coroutines.CoroutineAsyncStackTraceProvider
import org.jetbrains.kotlin.idea.debugger.coroutine.CoroutineAsyncStackTraceProvider
import org.jetbrains.kotlin.idea.debugger.test.preference.DebuggerPreferences
import org.jetbrains.kotlin.utils.addToStdlib.firstIsInstanceOrNull
import org.jetbrains.kotlin.utils.getSafe
@@ -11,14 +11,14 @@ import com.intellij.jarRepository.JarRepositoryManager
import com.intellij.jarRepository.RemoteRepositoryDescription
import org.jetbrains.idea.maven.aether.ArtifactKind
import org.jetbrains.jps.model.library.JpsMavenRepositoryLibraryDescriptor
import org.jetbrains.kotlin.idea.debugger.coroutines.data.CoroutineInfoData
import org.jetbrains.kotlin.idea.debugger.coroutines.proxy.CoroutinesDebugProbesProxy
import org.jetbrains.kotlin.idea.debugger.coroutine.data.CoroutineInfoData
import org.jetbrains.kotlin.idea.debugger.coroutine.proxy.CoroutineDebugProbesProxy
import org.jetbrains.kotlin.idea.debugger.test.preference.DebuggerPreferences
abstract class AbstractCoroutineDumpTest : KotlinDescriptorTestCaseWithStepping() {
override fun doMultiFileTest(files: TestFiles, preferences: DebuggerPreferences) {
doOnBreakpoint {
val infoCache = CoroutinesDebugProbesProxy(this).dumpCoroutines()
val infoCache = CoroutineDebugProbesProxy(this).dumpCoroutines()
try {
if (infoCache.isOk())
try {
@@ -34,7 +34,7 @@ abstract class AbstractCoroutineDumpTest : KotlinDescriptorTestCaseWithStepping(
}
doOnBreakpoint {
val infoCache = CoroutinesDebugProbesProxy(this).dumpCoroutines()
val infoCache = CoroutineDebugProbesProxy(this).dumpCoroutines()
try {
if (infoCache.isOk())
try {
+3 -3
View File
@@ -57,7 +57,7 @@
<group id="Kotlin.XDebugger.Actions">
<!-- TODO(design)-->
<action id="Kotlin.XDebugger.CoroutinesDump"
class="org.jetbrains.kotlin.idea.debugger.coroutines.command.CoroutineDumpAction"
class="org.jetbrains.kotlin.idea.debugger.coroutine.command.CoroutineDumpAction"
text="Get Coroutines Dump"
icon="/org/jetbrains/kotlin/idea/icons/kotlin.png"/>
</group>
@@ -90,7 +90,7 @@
<applicationService serviceImplementation="org.jetbrains.kotlin.idea.debugger.ToggleKotlinVariablesState"/>
<debugger.asyncStackTraceProvider implementation="org.jetbrains.kotlin.idea.debugger.coroutines.CoroutineAsyncStackTraceProvider"/>
<debugger.asyncStackTraceProvider implementation="org.jetbrains.kotlin.idea.debugger.coroutine.CoroutineAsyncStackTraceProvider"/>
<debugger.jvmSmartStepIntoHandler implementation="org.jetbrains.kotlin.idea.debugger.stepping.smartStepInto.KotlinSmartStepIntoHandler"/>
<debugger.positionManagerFactory implementation="org.jetbrains.kotlin.idea.debugger.KotlinPositionManagerFactory"/>
<debugger.codeFragmentFactory implementation="org.jetbrains.kotlin.idea.debugger.evaluate.KotlinCodeFragmentFactory"/>
@@ -111,7 +111,7 @@
<debugger.javaBreakpointHandlerFactory implementation="org.jetbrains.kotlin.idea.debugger.breakpoints.KotlinFunctionBreakpointHandlerFactory"/>
<debugger.jvmSteppingCommandProvider implementation="org.jetbrains.kotlin.idea.debugger.stepping.KotlinSteppingCommandProvider"/>
<debugger.simplePropertyGetterProvider implementation="org.jetbrains.kotlin.idea.debugger.stepping.KotlinSimpleGetterProvider"/>
<runConfigurationExtension implementation="org.jetbrains.kotlin.idea.debugger.coroutines.CoroutinesDebugConfigurationExtension"/>
<runConfigurationExtension implementation="org.jetbrains.kotlin.idea.debugger.coroutine.CoroutineDebugConfigurationExtension"/>
<framework.type implementation="org.jetbrains.kotlin.idea.framework.JavaFrameworkType"/>
<projectTemplatesFactory implementation="org.jetbrains.kotlin.idea.framework.KotlinTemplatesFactory" />
+1
View File
@@ -33,6 +33,7 @@ val projectsToShadow by extra(listOf(
":idea:jvm-debugger:jvm-debugger-util",
":idea:jvm-debugger:jvm-debugger-core",
":idea:jvm-debugger:jvm-debugger-evaluation",
":idea:jvm-debugger:jvm-debugger-coroutine",
":idea:jvm-debugger:jvm-debugger-sequence",
":idea:scripting-support",
":idea:idea-j2k",
+1
View File
@@ -159,6 +159,7 @@ include ":kotlin-build-common",
":idea:jvm-debugger:jvm-debugger-core",
":idea:jvm-debugger:jvm-debugger-evaluation",
":idea:jvm-debugger:jvm-debugger-sequence",
":idea:jvm-debugger:jvm-debugger-coroutine",
":idea:jvm-debugger:jvm-debugger-test",
":idea:scripting-support",
":libraries:tools:new-project-wizard",