Don't activate Kotlin async stack trace provider in Java sources (KT-30318)
This commit is contained in:
+3
@@ -65,6 +65,9 @@ class KotlinCoroutinesAsyncStackTraceProvider : KotlinCoroutinesAsyncStackTraceP
|
|||||||
|
|
||||||
fun getAsyncStackTrace(frameProxy: StackFrameProxyImpl, suspendContext: SuspendContextImpl): List<StackFrameItem>? {
|
fun getAsyncStackTrace(frameProxy: StackFrameProxyImpl, suspendContext: SuspendContextImpl): List<StackFrameItem>? {
|
||||||
val location = frameProxy.location()
|
val location = frameProxy.location()
|
||||||
|
if (!location.isInKotlinSources()) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
val method = location.safeMethod() ?: return null
|
val method = location.safeMethod() ?: return null
|
||||||
val currentThread = frameProxy.threadProxy().threadReference
|
val currentThread = frameProxy.threadProxy().threadReference
|
||||||
if (currentThread == null || !currentThread.isSuspended || !currentThread.isAtBreakpoint) {
|
if (currentThread == null || !currentThread.isSuspended || !currentThread.isAtBreakpoint) {
|
||||||
|
|||||||
@@ -91,9 +91,7 @@ class KotlinPositionManager(private val myDebugProcess: DebugProcess) : MultiReq
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun createStackFrame(frame: StackFrameProxyImpl, debugProcess: DebugProcessImpl, location: Location): XStackFrame? {
|
override fun createStackFrame(frame: StackFrameProxyImpl, debugProcess: DebugProcessImpl, location: Location): XStackFrame? {
|
||||||
val declaringType = location.declaringType()
|
if (location.isInKotlinSources()) {
|
||||||
val fileExtension = declaringType.safeSourceName()?.toLowerCase()?.substringAfterLast('.') ?: ""
|
|
||||||
if (fileExtension in KotlinFileTypeFactory.KOTLIN_EXTENSIONS || declaringType.containsKotlinStrata()) {
|
|
||||||
return KotlinStackFrame(frame)
|
return KotlinStackFrame(frame)
|
||||||
}
|
}
|
||||||
return null
|
return null
|
||||||
@@ -354,8 +352,6 @@ class KotlinPositionManager(private val myDebugProcess: DebugProcess) : MultiReq
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun ReferenceType.containsKotlinStrata() = availableStrata().contains(KOTLIN_STRATA_NAME)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline fun <U, V> U.readAction(crossinline f: (U) -> V): V {
|
inline fun <U, V> U.readAction(crossinline f: (U) -> V): V {
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ import org.jetbrains.kotlin.codegen.binding.CodegenBinding.asmTypeForAnonymousCl
|
|||||||
import org.jetbrains.kotlin.codegen.coroutines.DO_RESUME_METHOD_NAME
|
import org.jetbrains.kotlin.codegen.coroutines.DO_RESUME_METHOD_NAME
|
||||||
import org.jetbrains.kotlin.codegen.coroutines.INVOKE_SUSPEND_METHOD_NAME
|
import org.jetbrains.kotlin.codegen.coroutines.INVOKE_SUSPEND_METHOD_NAME
|
||||||
import org.jetbrains.kotlin.codegen.coroutines.continuationAsmTypes
|
import org.jetbrains.kotlin.codegen.coroutines.continuationAsmTypes
|
||||||
|
import org.jetbrains.kotlin.codegen.inline.KOTLIN_STRATA_NAME
|
||||||
|
import org.jetbrains.kotlin.idea.KotlinFileTypeFactory
|
||||||
import org.jetbrains.kotlin.idea.codeInsight.CodeInsightUtils
|
import org.jetbrains.kotlin.idea.codeInsight.CodeInsightUtils
|
||||||
import org.jetbrains.kotlin.idea.debugger.evaluate.KotlinDebuggerCaches
|
import org.jetbrains.kotlin.idea.debugger.evaluate.KotlinDebuggerCaches
|
||||||
import org.jetbrains.kotlin.idea.refactoring.getLineEndOffset
|
import org.jetbrains.kotlin.idea.refactoring.getLineEndOffset
|
||||||
@@ -30,6 +32,14 @@ import org.jetbrains.kotlin.resolve.inline.InlineUtil
|
|||||||
import org.jetbrains.org.objectweb.asm.Type as AsmType
|
import org.jetbrains.org.objectweb.asm.Type as AsmType
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
|
fun Location.isInKotlinSources(): Boolean {
|
||||||
|
val declaringType = declaringType()
|
||||||
|
val fileExtension = declaringType.safeSourceName()?.substringAfterLast('.')?.toLowerCase() ?: ""
|
||||||
|
return fileExtension in KotlinFileTypeFactory.KOTLIN_EXTENSIONS || declaringType.containsKotlinStrata()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun ReferenceType.containsKotlinStrata() = availableStrata().contains(KOTLIN_STRATA_NAME)
|
||||||
|
|
||||||
fun isInsideInlineArgument(
|
fun isInsideInlineArgument(
|
||||||
inlineArgument: KtFunction,
|
inlineArgument: KtFunction,
|
||||||
location: Location,
|
location: Location,
|
||||||
|
|||||||
Reference in New Issue
Block a user