Replace return with nop to avoid merging line instructions (KT-18949)
Dex ignores subsequent line numbers for same instructions and interprets instruction after inline as if they were inlined. This makes debugger behaves as if there's nowhere to stop on line with breakpoint. This also makes stepping through inline function consistent with non-inline analog. In both context debugger now stops on '}'. #KT-18949 Fixed #KT-17120 Fixed
This commit is contained in:
+1
-1
@@ -23,4 +23,4 @@ fun simpleFunVoid(f: () -> Unit): Unit {
|
||||
return f()
|
||||
}
|
||||
|
||||
// 5 NOP
|
||||
// 7 NOP
|
||||
|
||||
@@ -6,4 +6,4 @@ fun f() {
|
||||
|
||||
// 1 ISTORE 0\s+L3
|
||||
// 1 ILOAD 0\s+INVOKEVIRTUAL java/io/PrintStream.print \(C\)V
|
||||
// 1 LOCALVARIABLE c C L3 L6 0
|
||||
// 1 LOCALVARIABLE c C L3 L7 0
|
||||
|
||||
+1
-1
@@ -9,4 +9,4 @@ inline fun lookAtMe(f: (String) -> Unit) {
|
||||
f(a) // Should be no unneeded nops on this line, that might be generated for zero-parameters lambda
|
||||
}
|
||||
|
||||
// 2 NOP
|
||||
// 4 NOP
|
||||
+1
-1
@@ -14,4 +14,4 @@ fun main(args: Array<String>) {
|
||||
}
|
||||
|
||||
/*Threre are two constuctors so we should be sure that we check LOCALVARIABLEs from same method*/
|
||||
// 1 LOCALVARIABLE this LInlinedConstuctorWithSuperCallParamsKt\$main\$\$inlined\$test\$1; L0 L6 0\s+LOCALVARIABLE \$super_call_param\$1 Ljava/lang/String; L0 L6 1
|
||||
// 1 LOCALVARIABLE this LInlinedConstuctorWithSuperCallParamsKt\$main\$\$inlined\$test\$1; L0 L7 0\s+LOCALVARIABLE \$super_call_param\$1 Ljava/lang/String; L0 L7 1
|
||||
|
||||
Reference in New Issue
Block a user