Use class name instead internal name in coroutines debug metadata
I.e. instead of slashes use dots in fqnames. #KT-28237 Fixed
This commit is contained in:
+1
-1
@@ -284,7 +284,7 @@ class CoroutineTransformerMethodVisitor(
|
|||||||
variablesMapping.forEach { v.visit(null, it.variableName) }
|
variablesMapping.forEach { v.visit(null, it.variableName) }
|
||||||
}.visitEnd()
|
}.visitEnd()
|
||||||
metadata.visit(COROUTINES_METADATA_METHOD_NAME_JVM_NAME, methodNode.name)
|
metadata.visit(COROUTINES_METADATA_METHOD_NAME_JVM_NAME, methodNode.name)
|
||||||
metadata.visit(COROUTINES_METADATA_CLASS_NAME_JVM_NAME, containingClassInternalName)
|
metadata.visit(COROUTINES_METADATA_CLASS_NAME_JVM_NAME, Type.getObjectType(containingClassInternalName).className)
|
||||||
@Suppress("ConstantConditionIf")
|
@Suppress("ConstantConditionIf")
|
||||||
if (COROUTINES_DEBUG_METADATA_VERSION != 1) {
|
if (COROUTINES_DEBUG_METADATA_VERSION != 1) {
|
||||||
metadata.visit(COROUTINES_METADATA_VERSION_JVM_NAME, COROUTINES_DEBUG_METADATA_VERSION)
|
metadata.visit(COROUTINES_METADATA_VERSION_JVM_NAME, COROUTINES_DEBUG_METADATA_VERSION)
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
// !LANGUAGE: +ReleaseCoroutines
|
||||||
|
|
||||||
|
// IGNORE_BACKEND: JVM_IR
|
||||||
|
// TARGET_BACKEND: JVM
|
||||||
|
// WITH_RUNTIME
|
||||||
|
// FULL_JDK
|
||||||
|
// WITH_COROUTINES
|
||||||
|
|
||||||
|
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER", "CANNOT_OVERRIDE_INVISIBLE_MEMBER")
|
||||||
|
|
||||||
|
package some.long.name
|
||||||
|
|
||||||
|
import helpers.*
|
||||||
|
import kotlin.coroutines.*
|
||||||
|
import kotlin.coroutines.intrinsics.*
|
||||||
|
import kotlin.coroutines.jvm.internal.*
|
||||||
|
|
||||||
|
suspend fun dummy() {}
|
||||||
|
|
||||||
|
class Test {
|
||||||
|
suspend fun getStackTraceElement(): StackTraceElement {
|
||||||
|
dummy() // to force state-machine generation
|
||||||
|
return suspendCoroutineUninterceptedOrReturn<StackTraceElement> {
|
||||||
|
(it as BaseContinuationImpl).getStackTraceElement()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun builder(c: suspend () -> Unit) {
|
||||||
|
c.startCoroutine(EmptyContinuation)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
var res = "OK"
|
||||||
|
builder {
|
||||||
|
if (Test().getStackTraceElement().className != "some.long.name.Test") {
|
||||||
|
res = Test().getStackTraceElement().className
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return res
|
||||||
|
}
|
||||||
+5
@@ -6592,6 +6592,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
runTest("compiler/testData/codegen/box/coroutines/debug/firstSuspensionPoint.kt");
|
runTest("compiler/testData/codegen/box/coroutines/debug/firstSuspensionPoint.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("fqName.kt")
|
||||||
|
public void testFqName() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/coroutines/debug/fqName.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("runtimeDebugMetadata.kt")
|
@TestMetadata("runtimeDebugMetadata.kt")
|
||||||
public void testRuntimeDebugMetadata() throws Exception {
|
public void testRuntimeDebugMetadata() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/coroutines/debug/runtimeDebugMetadata.kt");
|
runTest("compiler/testData/codegen/box/coroutines/debug/runtimeDebugMetadata.kt");
|
||||||
|
|||||||
+5
@@ -6592,6 +6592,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
|||||||
runTest("compiler/testData/codegen/box/coroutines/debug/firstSuspensionPoint.kt");
|
runTest("compiler/testData/codegen/box/coroutines/debug/firstSuspensionPoint.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("fqName.kt")
|
||||||
|
public void testFqName() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/coroutines/debug/fqName.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("runtimeDebugMetadata.kt")
|
@TestMetadata("runtimeDebugMetadata.kt")
|
||||||
public void testRuntimeDebugMetadata() throws Exception {
|
public void testRuntimeDebugMetadata() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/coroutines/debug/runtimeDebugMetadata.kt");
|
runTest("compiler/testData/codegen/box/coroutines/debug/runtimeDebugMetadata.kt");
|
||||||
|
|||||||
+5
@@ -6592,6 +6592,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
|||||||
runTest("compiler/testData/codegen/box/coroutines/debug/firstSuspensionPoint.kt");
|
runTest("compiler/testData/codegen/box/coroutines/debug/firstSuspensionPoint.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("fqName.kt")
|
||||||
|
public void testFqName() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/coroutines/debug/fqName.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("runtimeDebugMetadata.kt")
|
@TestMetadata("runtimeDebugMetadata.kt")
|
||||||
public void testRuntimeDebugMetadata() throws Exception {
|
public void testRuntimeDebugMetadata() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/coroutines/debug/runtimeDebugMetadata.kt");
|
runTest("compiler/testData/codegen/box/coroutines/debug/runtimeDebugMetadata.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user