Debugger: Hide call-site 'this' in inline functions in Kotlin variables mode (KT-30610)

This commit is contained in:
Yan Zhulanow
2019-03-27 22:02:00 +03:00
parent 6dcaa64793
commit b7ea4ccc7e
8 changed files with 59 additions and 7 deletions
@@ -104,6 +104,8 @@ public class AsmUtil {
public static final String LABELED_THIS_FIELD = THIS + "_";
public static final String INLINE_DECLARATION_SITE_THIS = "this_";
public static final String LABELED_THIS_PARAMETER = "$" + THIS + "$";
public static final String CAPTURED_THIS_FIELD = "this$0";
@@ -487,7 +487,7 @@ class MethodInliner(
) {
if (isInliningLambda || GENERATE_DEBUG_INFO) {
val varSuffix = if (inliningContext.isRoot && !isFakeLocalVariableForInline(name)) INLINE_FUN_VAR_SUFFIX else ""
val varName = if (!varSuffix.isEmpty() && name == "this") name + "_" else name
val varName = if (!varSuffix.isEmpty() && name == AsmUtil.THIS) AsmUtil.INLINE_DECLARATION_SITE_THIS else name
super.visitLocalVariable(varName + varSuffix, desc, signature, start, end, getNewIndex(index))
}
}