Debugger: Fix breakpoint firing in '$suspendImpl' (KT-27645)

This commit is contained in:
Yan Zhulanow
2019-08-01 21:18:16 +09:00
parent 9096d211d3
commit 0a092d6613
9 changed files with 208 additions and 129 deletions
@@ -498,8 +498,10 @@ fun InstructionAdapter.invokeInvokeSuspendWithUnit(thisName: String) {
)
}
const val SUSPEND_IMPL_NAME_SUFFIX = "\$suspendImpl"
fun Method.getImplForOpenMethod(ownerInternalName: String) =
Method("$name\$suspendImpl", returnType, arrayOf(Type.getObjectType(ownerInternalName)) + argumentTypes)
Method(name + SUSPEND_IMPL_NAME_SUFFIX, returnType, arrayOf(Type.getObjectType(ownerInternalName)) + argumentTypes)
fun FunctionDescriptor.isSuspendLambdaOrLocalFunction() = this.isSuspend && when (this) {
is AnonymousFunctionDescriptor -> this.isSuspendLambda