Further refinements in variable displaying (Kotlin mode)

- Remove synthetic outer this for lambdas
- Recognize captured this for interface default methods
This commit is contained in:
Yan Zhulanow
2019-01-30 18:26:12 +03:00
parent 300c102c3f
commit 65b6098242
6 changed files with 103 additions and 14 deletions
@@ -0,0 +1,24 @@
package defaultImplsMangling
interface IFoo {
val x: Int
fun foo() {
//Breakpoint!
val a = 5
}
}
class Foo : IFoo {
override val x: Int = 1
}
fun main() {
Foo().foo()
}
// SHOW_KOTLIN_VARIABLES
// PRINT_FRAME
// EXPRESSION: x
// RESULT: 1: I
@@ -0,0 +1,11 @@
LineBreakpoint created at defaultImplsMangling.kt:8
Run Java
Connected to the target VM
defaultImplsMangling.kt:8
Compile bytecode for x
frame = foo:8, IFoo$DefaultImpls {defaultImplsMangling}
local = this: defaultImplsMangling.IFoo = {defaultImplsMangling.Foo@uniqueID} (sp = null)
field = x: int = 1 (sp = defaultImplsMangling.kt, 13)
Disconnected from the target VM
Process finished with exit code 0
@@ -0,0 +1,18 @@
package lambdaThisMangling
private fun block(block: (String) -> Unit) {
block("foo")
}
fun main() {
block { foo ->
//Breakpoint!
val a = 5
}
}
// SHOW_KOTLIN_VARIABLES
// PRINT_FRAME
// EXPRESSION: foo
// RESULT: "foo": Ljava/lang/String;
@@ -0,0 +1,15 @@
LineBreakpoint created at lambdaThisMangling.kt:10
Run Java
Connected to the target VM
lambdaThisMangling.kt:10
Compile bytecode for foo
frame = invoke:10, LambdaThisManglingKt$main$1 {lambdaThisMangling}
local = foo: java.lang.String = foo (sp = lambdaThisMangling.kt, 8)
field = value: char[] = {char[3]@uniqueID} (sp = String.!EXT!)
element = 0 = 'f' 102
element = 1 = 'o' 111
element = 2 = 'o' 111
field = hash: int = 0 (sp = String.!EXT!)
Disconnected from the target VM
Process finished with exit code 0