Watches: Add Kotlin/JVM views to watches window (KT-28134, KT-28087, KT-22250)
Kotlin mode: show only Kotlin variables and captured values. The variable names are Kotlin-friendly. JVM mode: show all variables available in the current stack position, including synthetic ones.
This commit is contained in:
+2
@@ -33,7 +33,9 @@ class A {
|
||||
local = element: int = 1 (sp = frameInlineArgument.kt, 4)
|
||||
local = this_$iv: frameInlineArgument.A = {frameInlineArgument.A@uniqueID} (sp = null)
|
||||
field = prop: int = 1 (sp = frameInlineArgument.kt, 17)
|
||||
local = $i$f$inlineFun: int = undefined (sp = null)
|
||||
local = element$iv: double = 1.0 (sp = frameInlineArgument.kt, 4)
|
||||
local = $i$a$-inlineFun-FrameInlineArgumentKt$main$1: int = undefined (sp = null)
|
||||
Disconnected from the target VM
|
||||
|
||||
Process finished with exit code 0
|
||||
|
||||
+3
@@ -47,11 +47,14 @@ fun main(args: Array<String>) {
|
||||
local = element: float = 1.0 (sp = frameInlineArgumentInsideInlineFun.kt, 13)
|
||||
local = this_$iv: frameInlineArgumentInsideInlineFun.B = {frameInlineArgumentInsideInlineFun.B@uniqueID} (sp = null)
|
||||
- Class has no fields
|
||||
local = $i$f$foo: int = undefined (sp = null)
|
||||
local = element$iv: int = 1 (sp = frameInlineArgumentInsideInlineFun.kt, 13)
|
||||
local = this_$iv$iv: frameInlineArgumentInsideInlineFun.A = {frameInlineArgumentInsideInlineFun.A@uniqueID} (sp = null)
|
||||
- Class has no fields
|
||||
local = $i$f$inlineFun: int = undefined (sp = null)
|
||||
local = element$iv$iv: double = 1.0 (sp = frameInlineArgumentInsideInlineFun.kt, 13)
|
||||
local = it$iv: int = 1 (sp = null)
|
||||
local = $i$a$-inlineFun-B$foo$1: int = undefined (sp = null)
|
||||
Disconnected from the target VM
|
||||
|
||||
Process finished with exit code 0
|
||||
|
||||
+1
@@ -37,6 +37,7 @@ class A {
|
||||
local = element: int = 1 (sp = frameInlineFun.kt, 12)
|
||||
local = this_$iv: frameInlineFun.A = {frameInlineFun.A@uniqueID} (sp = null)
|
||||
field = prop: int = 1 (sp = frameInlineFun.kt, 17)
|
||||
local = $i$f$inlineFun: int = undefined (sp = null)
|
||||
local = element$iv: double = 1.0 (sp = frameInlineFun.kt, 12)
|
||||
Disconnected from the target VM
|
||||
|
||||
|
||||
+2
@@ -60,11 +60,13 @@ fun main(args: Array<String>) {
|
||||
local = element: float = 1.0 (sp = frameInlineFunCallInsideInlineFun.kt, 5)
|
||||
local = this_$iv: frameInlineFunCallInsideInlineFun.B = {frameInlineFunCallInsideInlineFun.B@uniqueID} (sp = null)
|
||||
- Class has no fields
|
||||
local = $i$f$foo: int = undefined (sp = null)
|
||||
local = element$iv: int = 2 (sp = frameInlineFunCallInsideInlineFun.kt, 5)
|
||||
local = a$iv: frameInlineFunCallInsideInlineFun.A = {frameInlineFunCallInsideInlineFun.A@uniqueID} (sp = null)
|
||||
field = prop: int = 1 (sp = frameInlineFunCallInsideInlineFun.kt, 10)
|
||||
local = this_$iv$iv: frameInlineFunCallInsideInlineFun.A = {frameInlineFunCallInsideInlineFun.A@uniqueID} (sp = null)
|
||||
field = prop: int = 1 (sp = frameInlineFunCallInsideInlineFun.kt, 10)
|
||||
local = $i$f$inlineFun: int = undefined (sp = null)
|
||||
local = element$iv$iv: double = 1.0 (sp = frameInlineFunCallInsideInlineFun.kt, 5)
|
||||
Disconnected from the target VM
|
||||
|
||||
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
// SHOW_KOTLIN_VARIABLES
|
||||
|
||||
package frameInlineFunCallInsideInlineFunKotlinVariables
|
||||
|
||||
class A {
|
||||
inline fun inlineFun(s: (Int) -> Unit) {
|
||||
val element = 1.0
|
||||
//TODO breakpoint here doesn't work (not only in tests)
|
||||
s(1)
|
||||
}
|
||||
|
||||
val prop = 1
|
||||
}
|
||||
|
||||
class B {
|
||||
inline fun foo(s: (Int) -> Unit) {
|
||||
val element = 2
|
||||
val a = A()
|
||||
// STEP_INTO: 1
|
||||
// STEP_OVER: 1
|
||||
//Breakpoint!
|
||||
a.inlineFun {
|
||||
val e = element
|
||||
}
|
||||
s(1)
|
||||
}
|
||||
}
|
||||
|
||||
class C {
|
||||
fun bar() {
|
||||
val element = 1f
|
||||
B().foo {
|
||||
val e = element
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
C().bar()
|
||||
}
|
||||
|
||||
// PRINT_FRAME
|
||||
|
||||
// EXPRESSION: element
|
||||
// RESULT: 1.0: D
|
||||
|
||||
// EXPRESSION: this.prop
|
||||
// RESULT: 1: I
|
||||
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
LineBreakpoint created at frameInlineFunCallInsideInlineFunKotlinVariables.kt:22
|
||||
Run Java
|
||||
Connected to the target VM
|
||||
frameInlineFunCallInsideInlineFunKotlinVariables.kt:22
|
||||
frameInlineFunCallInsideInlineFunKotlinVariables.kt:7
|
||||
frameInlineFunCallInsideInlineFunKotlinVariables.kt:9
|
||||
Compile bytecode for element
|
||||
Compile bytecode for this.prop
|
||||
// SHOW_KOTLIN_VARIABLES
|
||||
|
||||
package frameInlineFunCallInsideInlineFunKotlinVariables
|
||||
|
||||
class A {
|
||||
inline fun inlineFun(s: (Int) -> Unit) {
|
||||
val element = 1.0
|
||||
//TODO breakpoint here doesn't work (not only in tests)
|
||||
s(1)
|
||||
}
|
||||
|
||||
val prop = 1
|
||||
}
|
||||
|
||||
class B {
|
||||
inline fun foo(s: (Int) -> Unit) {
|
||||
val element = 2
|
||||
val a = A()
|
||||
// STEP_INTO: 1
|
||||
// STEP_OVER: 1
|
||||
//Breakpoint!
|
||||
a.inlineFun {
|
||||
val e = element
|
||||
}
|
||||
s(1)
|
||||
}
|
||||
}
|
||||
|
||||
class C {
|
||||
fun bar() {
|
||||
val element = 1f
|
||||
B().foo {
|
||||
val e = element
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
C().bar()
|
||||
}
|
||||
|
||||
// PRINT_FRAME
|
||||
|
||||
// EXPRESSION: element
|
||||
// RESULT: 1.0: D
|
||||
|
||||
// EXPRESSION: this.prop
|
||||
// RESULT: 1: I
|
||||
|
||||
|
||||
frame = bar:9, C {frameInlineFunCallInsideInlineFunKotlinVariables}
|
||||
this = this = {frameInlineFunCallInsideInlineFunKotlinVariables.C@uniqueID}
|
||||
- Class has no fields
|
||||
local = element: float = 1.0 (sp = frameInlineFunCallInsideInlineFunKotlinVariables.kt, 7)
|
||||
Disconnected from the target VM
|
||||
|
||||
Process finished with exit code 0
|
||||
Vendored
+2
@@ -24,6 +24,8 @@ inline fun foo(f: () -> Unit) {
|
||||
frame = main:7, FrameSharedVarLocalVarKt {frameSharedVarLocalVar}
|
||||
local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = frameSharedVarLocalVar.kt, 3)
|
||||
local = var1: int = 1 (sp = frameSharedVarLocalVar.kt, 4)
|
||||
local = $i$f$foo: int = undefined (sp = null)
|
||||
local = $i$a$-foo-FrameSharedVarLocalVarKt$main$1: int = undefined (sp = null)
|
||||
Disconnected from the target VM
|
||||
|
||||
Process finished with exit code 0
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package kt28087
|
||||
|
||||
fun main() {
|
||||
"a".indexed { index, c ->
|
||||
//Breakpoint!
|
||||
val a = 5
|
||||
}
|
||||
}
|
||||
|
||||
private inline fun CharSequence.indexed(action: (index: Int, Char) -> Unit): Unit {
|
||||
var index = 0
|
||||
for (item in this) action(index++, item)
|
||||
}
|
||||
|
||||
// EXPRESSION: index
|
||||
// RESULT: 0: I
|
||||
@@ -0,0 +1,8 @@
|
||||
LineBreakpoint created at kt28087.kt:6
|
||||
Run Java
|
||||
Connected to the target VM
|
||||
kt28087.kt:6
|
||||
Compile bytecode for index
|
||||
Disconnected from the target VM
|
||||
|
||||
Process finished with exit code 0
|
||||
Reference in New Issue
Block a user