Allow '// PRINT_FRAME' option for multi-breakpoint stepping tests

This commit is contained in:
Yan Zhulanow
2018-12-26 15:38:36 +03:00
parent 16b94feea6
commit 7fb8357b28
48 changed files with 43 additions and 1168 deletions
@@ -2,19 +2,6 @@ LineBreakpoint created at createExpressionCastToBuiltIn.kt:7
Run Java Run Java
Connected to the target VM Connected to the target VM
createExpressionCastToBuiltIn.kt:7 createExpressionCastToBuiltIn.kt:7
package createExpressionCastToBuiltIn
fun main(args: Array<String>) {
val primitiveArray = intArrayOf(1)
val stringArray = arrayOf("a")
//Breakpoint!
val a = 1
}
// PRINT_FRAME
// SKIP: value, hash, hash32, offset, count
// DESCRIPTOR_VIEW_OPTIONS: NAME_EXPRESSION_RESULT
Compile bytecode for args Compile bytecode for args
Compile bytecode for primitiveArray Compile bytecode for primitiveArray
Compile bytecode for primitiveArray[0] Compile bytecode for primitiveArray[0]
@@ -2,26 +2,6 @@ LineBreakpoint created at createExpressionSimple.kt:15
Run Java Run Java
Connected to the target VM Connected to the target VM
createExpressionSimple.kt:15 createExpressionSimple.kt:15
package createExpressionSimple
class MyClass: Base() {
val i = 1
}
open class Base {
val baseI = 2
}
fun main(args: Array<String>) {
val myClass: Base = MyClass()
val myBase = Base()
//Breakpoint!
val a = 1
}
// PRINT_FRAME
// DESCRIPTOR_VIEW_OPTIONS: NAME_EXPRESSION
frame = main frame = main
local = args (expression = args) local = args (expression = args)
local = myClass (expression = myClass) local = myClass (expression = myClass)
@@ -2,22 +2,6 @@ LineBreakpoint created at createExpressionWithArray.kt:11
Run Java Run Java
Connected to the target VM Connected to the target VM
createExpressionWithArray.kt:11 createExpressionWithArray.kt:11
package createExpressionWithArray
import forTests.MyJavaClass
// do not remove this import, it checks that we do not insert ambiguous imports during EE
import forTests.MyJavaClass.InnerClass
fun main(args: Array<String>) {
val baseArray = arrayOf(MyJavaClass().getBaseClassValue())
val innerArray = arrayOf(MyJavaClass().getInnerClassValue())
//Breakpoint!
val a = 1
}
// PRINT_FRAME
// DESCRIPTOR_VIEW_OPTIONS: NAME_EXPRESSION_RESULT
Compile bytecode for args Compile bytecode for args
Compile bytecode for baseArray Compile bytecode for baseArray
Compile bytecode for baseArray[0] Compile bytecode for baseArray[0]
@@ -2,24 +2,6 @@ LineBreakpoint created at evBreakpointOnPropertyDeclaration.kt:14
Run Java Run Java
Connected to the target VM Connected to the target VM
evBreakpointOnPropertyDeclaration.kt:14 evBreakpointOnPropertyDeclaration.kt:14
package evBreakpointOnPropertyDeclaration
class A {
var prop = 1
}
fun main(args: Array<String>) {
val a1 = A()
val a2 = A()
val a3 = A()
val p1 = a1.prop
//Breakpoint!
val p2 = a2.prop
val p3 = a3.prop
}
// PRINT_FRAME
Compile bytecode for a2.prop Compile bytecode for a2.prop
frame = main:14, EvBreakpointOnPropertyDeclarationKt {evBreakpointOnPropertyDeclaration} frame = main:14, EvBreakpointOnPropertyDeclarationKt {evBreakpointOnPropertyDeclaration}
local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = evBreakpointOnPropertyDeclaration.kt, 7) local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = evBreakpointOnPropertyDeclaration.kt, 7)
@@ -2,22 +2,6 @@ LineBreakpoint created at evDelegatedProperty.kt:13
Run Java Run Java
Connected to the target VM Connected to the target VM
evDelegatedProperty.kt:13 evDelegatedProperty.kt:13
package evDelegatedProperty
import kotlin.properties.Delegates
class A {
var prop: Int by Delegates.notNull()
}
fun main(args: Array<String>) {
val a = A()
a.prop = 1
//Breakpoint!
val b = a.prop
}
// PRINT_FRAME
frame = main:13, EvDelegatedPropertyKt {evDelegatedProperty} frame = main:13, EvDelegatedPropertyKt {evDelegatedProperty}
local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = evDelegatedProperty.kt, 9) local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = evDelegatedProperty.kt, 9)
local = a: evDelegatedProperty.A = {evDelegatedProperty.A@uniqueID} (sp = evDelegatedProperty.kt, 10) local = a: evDelegatedProperty.A = {evDelegatedProperty.A@uniqueID} (sp = evDelegatedProperty.kt, 10)
@@ -2,19 +2,6 @@ LineBreakpoint created at evDuplicateItems.kt:10
Run Java Run Java
Connected to the target VM Connected to the target VM
evDuplicateItems.kt:10 evDuplicateItems.kt:10
package evDuplicateItems
class A {
var prop = 1
}
fun main(args: Array<String>) {
val a = A()
//Breakpoint!
val b = a.prop + a.prop
}
// PRINT_FRAME
Compile bytecode for a.prop Compile bytecode for a.prop
frame = main:10, EvDuplicateItemsKt {evDuplicateItems} frame = main:10, EvDuplicateItemsKt {evDuplicateItems}
local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = evDuplicateItems.kt, 7) local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = evDuplicateItems.kt, 7)
@@ -2,19 +2,6 @@ LineBreakpoint created at evFinalProperty.kt:10
Run Java Run Java
Connected to the target VM Connected to the target VM
evFinalProperty.kt:10 evFinalProperty.kt:10
package evFinalProperty
class A {
val prop = 1
}
fun main(args: Array<String>) {
val a = A()
//Breakpoint!
val b = a.prop
}
// PRINT_FRAME
frame = main:10, EvFinalPropertyKt {evFinalProperty} frame = main:10, EvFinalPropertyKt {evFinalProperty}
local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = evFinalProperty.kt, 7) local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = evFinalProperty.kt, 7)
local = a: evFinalProperty.A = {evFinalProperty.A@uniqueID} (sp = evFinalProperty.kt, 8) local = a: evFinalProperty.A = {evFinalProperty.A@uniqueID} (sp = evFinalProperty.kt, 8)
@@ -2,18 +2,6 @@ LineBreakpoint created at evFunctionDeclaration.kt:5
Run Java Run Java
Connected to the target VM Connected to the target VM
evFunctionDeclaration.kt:5 evFunctionDeclaration.kt:5
package evFunctionDeclaration
class A(val a: Int) {
//Breakpoint!
fun foo() = a
}
fun main(args: Array<String>) {
A(1).foo()
}
// PRINT_FRAME
Compile bytecode for a Compile bytecode for a
frame = foo:5, A {evFunctionDeclaration} frame = foo:5, A {evFunctionDeclaration}
this = this = {evFunctionDeclaration.A@uniqueID} this = this = {evFunctionDeclaration.A@uniqueID}
@@ -2,28 +2,6 @@ LineBreakpoint created at evLineRange.kt:15
Run Java Run Java
Connected to the target VM Connected to the target VM
evLineRange.kt:15 evLineRange.kt:15
package evLineRange
class A {
var prop = 1
}
fun main(args: Array<String>) {
val a1 = A()
val a2 = A()
val a3 = A()
foo(a1.prop)
val i1 = 1
//Breakpoint!
foo(a2.prop)
val i2 = 1
foo(a3.prop)
}
fun foo(i: Int) {}
// PRINT_FRAME
Compile bytecode for a2.prop Compile bytecode for a2.prop
frame = main:15, EvLineRangeKt {evLineRange} frame = main:15, EvLineRangeKt {evLineRange}
local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = evLineRange.kt, 7) local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = evLineRange.kt, 7)
@@ -2,21 +2,6 @@ LineBreakpoint created at evProperty.kt:10
Run Java Run Java
Connected to the target VM Connected to the target VM
evProperty.kt:10 evProperty.kt:10
package evProperty
class A {
var prop = 1
}
fun main(args: Array<String>) {
val a = A()
//Breakpoint!
if (a.prop == 1) {
}
}
// PRINT_FRAME
Compile bytecode for a.prop Compile bytecode for a.prop
frame = main:10, EvPropertyKt {evProperty} frame = main:10, EvPropertyKt {evProperty}
local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = evProperty.kt, 7) local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = evProperty.kt, 7)
@@ -2,24 +2,6 @@ LineBreakpoint created at evPropertyRefExpr.kt:8
Run Java Run Java
Connected to the target VM Connected to the target VM
evPropertyRefExpr.kt:8 evPropertyRefExpr.kt:8
package evPropertyRefExpr
class A {
var prop = 1
fun test() {
//Breakpoint!
if (prop == 1) {
}
}
}
fun main(args: Array<String>) {
A().test()
}
// PRINT_FRAME
Compile bytecode for prop Compile bytecode for prop
frame = test:8, A {evPropertyRefExpr} frame = test:8, A {evPropertyRefExpr}
this = this = {evPropertyRefExpr.A@uniqueID} this = this = {evPropertyRefExpr.A@uniqueID}
@@ -2,32 +2,6 @@ LineBreakpoint created at evSkipAnonymousObject.kt:12
Run Java Run Java
Connected to the target VM Connected to the target VM
evSkipAnonymousObject.kt:12 evSkipAnonymousObject.kt:12
package evSkipAnonymousObject
class A {
var prop = 1
}
fun main(args: Array<String>) {
val a1 = A()
val a2 = A()
//Breakpoint!
foo(a1.prop)
object: T {
override fun f() {
foo(a2.prop)
}
}
}
interface T {
fun f() {}
}
fun foo(i: Int) {}
// PRINT_FRAME
Compile bytecode for a1.prop Compile bytecode for a1.prop
frame = main:12, EvSkipAnonymousObjectKt {evSkipAnonymousObject} frame = main:12, EvSkipAnonymousObjectKt {evSkipAnonymousObject}
local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = evSkipAnonymousObject.kt, 7) local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = evSkipAnonymousObject.kt, 7)
@@ -2,27 +2,6 @@ LineBreakpoint created at evSkipLambda.kt:12
Run Java Run Java
Connected to the target VM Connected to the target VM
evSkipLambda.kt:12 evSkipLambda.kt:12
package evSkipLambda
class A {
var prop = 1
}
fun main(args: Array<String>) {
val a1 = A()
val a2 = A()
//Breakpoint!
foo(a1.prop)
l {
foo(a2.prop)
}
}
fun foo(i: Int) {}
fun l(f: () -> Unit) {}
// PRINT_FRAME
Compile bytecode for a1.prop Compile bytecode for a1.prop
frame = main:12, EvSkipLambdaKt {evSkipLambda} frame = main:12, EvSkipLambdaKt {evSkipLambda}
local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = evSkipLambda.kt, 7) local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = evSkipLambda.kt, 7)
@@ -2,28 +2,6 @@ LineBreakpoint created at evSkipLocalClass.kt:12
Run Java Run Java
Connected to the target VM Connected to the target VM
evSkipLocalClass.kt:12 evSkipLocalClass.kt:12
package evSkipLocalClass
class A {
var prop = 1
}
fun main(args: Array<String>) {
val a1 = A()
val a2 = A()
//Breakpoint!
foo(a1.prop)
class B {
fun bar() {
foo(a2.prop)
}
}
}
fun foo(i: Int) {}
// PRINT_FRAME
Compile bytecode for a1.prop Compile bytecode for a1.prop
frame = main:12, EvSkipLocalClassKt {evSkipLocalClass} frame = main:12, EvSkipLocalClassKt {evSkipLocalClass}
local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = evSkipLocalClass.kt, 7) local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = evSkipLocalClass.kt, 7)
@@ -2,20 +2,6 @@ LineBreakpoint created at catchVariable.kt:9
Run Java Run Java
Connected to the target VM Connected to the target VM
catchVariable.kt:9 catchVariable.kt:9
package catchVariable
fun main(args: Array<String>) {
try {
throw Exception()
}
//Breakpoint!
catch (e: Exception) {
}
}
// PRINT_FRAME
frame = main:9, CatchVariableKt {catchVariable} frame = main:9, CatchVariableKt {catchVariable}
local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = catchVariable.kt, 3) local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = catchVariable.kt, 3)
Disconnected from the target VM Disconnected from the target VM
@@ -2,34 +2,6 @@ LineBreakpoint created at delegatedPropertyInClass.kt:9
Run Java Run Java
Connected to the target VM Connected to the target VM
delegatedPropertyInClass.kt:9 delegatedPropertyInClass.kt:9
package delegatedPropertyInClass
import kotlin.properties.Delegates
import kotlin.reflect.KProperty
fun main(args: Array<String>) {
val a = A()
//Breakpoint!
args.size
}
class A {
val prop by MyDelegate()
val propEx by MyDelegateThrowsException()
}
class MyDelegate {
operator fun getValue(t: Any?, p: KProperty<*>): Int = 1
}
class MyDelegateThrowsException {
operator fun getValue(t: Any?, p: KProperty<*>): Int = throw IllegalStateException()
}
// PRINT_FRAME
// SKIP: suppressedExceptions
// SKIP: stackTrace
Compile bytecode for args.size Compile bytecode for args.size
frame = main:9, DelegatedPropertyInClassKt {delegatedPropertyInClass} frame = main:9, DelegatedPropertyInClassKt {delegatedPropertyInClass}
local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = delegatedPropertyInClass.kt, 6) local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = delegatedPropertyInClass.kt, 6)
@@ -2,28 +2,6 @@ LineBreakpoint created at delegatedPropertyInClassWithToString.kt:8
Run Java Run Java
Connected to the target VM Connected to the target VM
delegatedPropertyInClassWithToString.kt:8 delegatedPropertyInClassWithToString.kt:8
package delegatedPropertyInClassWithToString
import kotlin.reflect.KProperty
fun main(args: Array<String>) {
val a = A()
//Breakpoint!
args.size
}
class A {
val prop by MyDelegate()
override fun toString(): String = "KotlinTest"
}
class MyDelegate {
operator fun getValue(t: Any?, p: KProperty<*>): Int = 1
}
// PRINT_FRAME
Compile bytecode for args.size Compile bytecode for args.size
frame = main:8, DelegatedPropertyInClassWithToStringKt {delegatedPropertyInClassWithToString} frame = main:8, DelegatedPropertyInClassWithToStringKt {delegatedPropertyInClassWithToString}
local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = delegatedPropertyInClassWithToString.kt, 5) local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = delegatedPropertyInClassWithToString.kt, 5)
@@ -2,28 +2,6 @@ LineBreakpoint created at delegatedPropertyInClassWoRenderer.kt:9
Run Java Run Java
Connected to the target VM Connected to the target VM
delegatedPropertyInClassWoRenderer.kt:9 delegatedPropertyInClassWoRenderer.kt:9
package delegatedPropertyInClassWoRenderer
import kotlin.properties.Delegates
import kotlin.reflect.KProperty
fun main(args: Array<String>) {
val a = A()
//Breakpoint!
args.size
}
class A {
val prop by MyDelegate()
}
class MyDelegate {
operator fun getValue(t: Any?, p: KProperty<*>): Int = 1
}
// RENDER_DELEGATED_PROPERTIES: false
// PRINT_FRAME
Compile bytecode for args.size Compile bytecode for args.size
frame = main:9, DelegatedPropertyInClassWoRendererKt {delegatedPropertyInClassWoRenderer} frame = main:9, DelegatedPropertyInClassWoRendererKt {delegatedPropertyInClassWoRenderer}
local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = delegatedPropertyInClassWoRenderer.kt, 6) local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = delegatedPropertyInClassWoRenderer.kt, 6)
@@ -2,29 +2,6 @@ LineBreakpoint created at frameAnonymousObject.kt:11
Run Java Run Java
Connected to the target VM Connected to the target VM
frameAnonymousObject.kt:11 frameAnonymousObject.kt:11
package frameAnonymousObject
fun main(args: Array<String>) {
val val1 = 1
val o = object {
val obProp = 1
fun run() {
foo {
//Breakpoint!
val1 + obProp
}
}
}
o.run()
}
fun foo(f: () -> Unit) {
f()
}
// PRINT_FRAME
frame = invoke:11, FrameAnonymousObjectKt$main$o$1$run$1 {frameAnonymousObject} frame = invoke:11, FrameAnonymousObjectKt$main$o$1$run$1 {frameAnonymousObject}
this = this = {frameAnonymousObject.FrameAnonymousObjectKt$main$o$1$run$1@uniqueID}Function0<kotlin.Unit> this = this = {frameAnonymousObject.FrameAnonymousObjectKt$main$o$1$run$1@uniqueID}Function0<kotlin.Unit>
field = this$0: frameAnonymousObject.FrameAnonymousObjectKt$main$o$1 = {frameAnonymousObject.FrameAnonymousObjectKt$main$o$1@uniqueID} (sp = null) field = this$0: frameAnonymousObject.FrameAnonymousObjectKt$main$o$1 = {frameAnonymousObject.FrameAnonymousObjectKt$main$o$1@uniqueID} (sp = null)
@@ -4,37 +4,6 @@ Connected to the target VM
frameClassObject.kt:16 frameClassObject.kt:16
Compile bytecode for prop Compile bytecode for prop
Compile bytecode for myFun() Compile bytecode for myFun()
package frameClassObject
fun main(args: Array<String>) {
A().test()
}
class A {
companion object {
val prop = 1
fun myFun() = 1
}
fun test() {
foo {
//Breakpoint!
prop
}
}
}
fun foo(f: () -> Unit) {
f()
}
// PRINT_FRAME
// EXPRESSION: prop
// RESULT: 1: I
// EXPRESSION: myFun()
// RESULT: 1: I
frame = invoke:16, A$test$1 {frameClassObject} frame = invoke:16, A$test$1 {frameClassObject}
this = this = {frameClassObject.A$test$1@uniqueID}Function0<kotlin.Unit> this = this = {frameClassObject.A$test$1@uniqueID}Function0<kotlin.Unit>
field = arity: int = 0 (sp = Lambda.!EXT!) field = arity: int = 0 (sp = Lambda.!EXT!)
@@ -3,17 +3,6 @@ Run Java
Connected to the target VM Connected to the target VM
frameClosingBracket.kt:6 frameClosingBracket.kt:6
Compile bytecode for a Compile bytecode for a
package frameClosingBracket
fun main(args: Array<String>) {
val a = 1
//Breakpoint!
}
// PRINT_FRAME
// EXPRESSION: a
// RESULT: 1: I
frame = main:6, FrameClosingBracketKt {frameClosingBracket} frame = main:6, FrameClosingBracketKt {frameClosingBracket}
local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = frameClosingBracket.kt, 3) local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = frameClosingBracket.kt, 3)
local = a: int = 1 (sp = frameClosingBracket.kt, 4) local = a: int = 1 (sp = frameClosingBracket.kt, 4)
@@ -10,79 +10,6 @@ Compile bytecode for bProp
Compile bytecode for aMyFun() Compile bytecode for aMyFun()
Compile bytecode for outerMyFun() Compile bytecode for outerMyFun()
Compile bytecode for bMyFun() Compile bytecode for bMyFun()
package frameExtFunExtFun
fun main(args: Array<String>) {
Outer().run()
}
class A {
val aProp = 1
fun aMyFun() = 1
}
class Outer {
val outerProp = 1
fun outerMyFun() = 1
fun A.foo() {
val valFoo = 1
class LocalClass {
val lcProp = 1
fun B.test() {
val valTest = 1
lambda {
//Breakpoint!
outerProp + aProp + lcProp + bProp + valFoo + valTest
}
}
fun run() {
B().test()
}
}
LocalClass().run()
}
fun run() {
A().foo()
}
}
class B {
val bProp = 1
fun bMyFun() = 1
}
fun lambda(f: () -> Unit) {
f()
}
// PRINT_FRAME
// EXPRESSION: valFoo
// RESULT: 1: I
// EXPRESSION: valTest
// RESULT: 1: I
// EXPRESSION: aProp
// RESULT: 1: I
// EXPRESSION: outerProp
// RESULT: 1: I
// EXPRESSION: bProp
// RESULT: 1: I
// EXPRESSION: aMyFun()
// RESULT: 1: I
// EXPRESSION: outerMyFun()
// RESULT: 1: I
// EXPRESSION: bMyFun()
// RESULT: 1: I
frame = invoke:24, Outer$foo$LocalClass$test$1 {frameExtFunExtFun} frame = invoke:24, Outer$foo$LocalClass$test$1 {frameExtFunExtFun}
this = this = {frameExtFunExtFun.Outer$foo$LocalClass$test$1@uniqueID}Function0<kotlin.Unit> this = this = {frameExtFunExtFun.Outer$foo$LocalClass$test$1@uniqueID}Function0<kotlin.Unit>
field = this$0: frameExtFunExtFun.Outer$foo$LocalClass = {frameExtFunExtFun.Outer$foo$LocalClass@uniqueID} (sp = null) field = this$0: frameExtFunExtFun.Outer$foo$LocalClass = {frameExtFunExtFun.Outer$foo$LocalClass@uniqueID} (sp = null)
@@ -4,29 +4,6 @@ Connected to the target VM
frameExtensionFun.kt:14 frameExtensionFun.kt:14
Compile bytecode for prop Compile bytecode for prop
Compile bytecode for myFun() Compile bytecode for myFun()
package frameExtensionFun
fun main(args: Array<String>) {
A().foo()
}
class A {
val prop = 1
fun myFun() = 1
}
fun A.foo() {
//Breakpoint!
prop
}
// PRINT_FRAME
// EXPRESSION: prop
// RESULT: 1: I
// EXPRESSION: myFun()
// RESULT: 1: I
frame = foo:14, FrameExtensionFunKt {frameExtensionFun} frame = foo:14, FrameExtensionFunKt {frameExtensionFun}
local = $this$foo: frameExtensionFun.A = {frameExtensionFun.A@uniqueID} (sp = null) local = $this$foo: frameExtensionFun.A = {frameExtensionFun.A@uniqueID} (sp = null)
field = prop: int = 1 (sp = frameExtensionFun.kt, 8) field = prop: int = 1 (sp = frameExtensionFun.kt, 8)
@@ -3,31 +3,6 @@ Run Java
Connected to the target VM Connected to the target VM
frameInlineArgument.kt:7 frameInlineArgument.kt:7
Compile bytecode for element Compile bytecode for element
package frameInlineArgument
fun main(args: Array<String>) {
val element = 1
A().inlineFun {
//Breakpoint!
element
}
}
class A {
inline fun inlineFun(s: () -> Unit) {
val element = 1.0
s()
}
val prop = 1
}
// PRINT_FRAME
// EXPRESSION: element
// RESULT: 1: I
frame = main:7, FrameInlineArgumentKt {frameInlineArgument} frame = main:7, FrameInlineArgumentKt {frameInlineArgument}
local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = frameInlineArgument.kt, 3) local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = frameInlineArgument.kt, 3)
local = element: int = 1 (sp = frameInlineArgument.kt, 4) local = element: int = 1 (sp = frameInlineArgument.kt, 4)
@@ -3,44 +3,6 @@ Run Java
Connected to the target VM Connected to the target VM
frameInlineArgumentInsideInlineFun.kt:16 frameInlineArgumentInsideInlineFun.kt:16
Compile bytecode for element Compile bytecode for element
// KT-10674: Debugger: Evaluate Expression / Watches fail for variable/parameter captured from one inline function to another
package frameInlineArgumentInsideInlineFun
class A {
inline fun inlineFun(s: (Int) -> Unit) {
val element = 1.0
s(1)
}
}
class B {
inline fun foo(s: (Int) -> Unit) {
val element = 1
A().inlineFun {
//Breakpoint!
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: I
frame = bar:16, C {frameInlineArgumentInsideInlineFun} frame = bar:16, C {frameInlineArgumentInsideInlineFun}
this = this = {frameInlineArgumentInsideInlineFun.C@uniqueID} this = this = {frameInlineArgumentInsideInlineFun.C@uniqueID}
- Class has no fields - Class has no fields
@@ -4,34 +4,6 @@ Connected to the target VM
frameInlineFun.kt:14 frameInlineFun.kt:14
Compile bytecode for element Compile bytecode for element
Compile bytecode for this.prop Compile bytecode for this.prop
package frameInlineFun
fun main(args: Array<String>) {
val element = 1
A().inlineFun {
element
}
}
class A {
inline fun inlineFun(s: (Int) -> Unit) {
val element = 1.0
//Breakpoint!
s(1)
}
val prop = 1
}
// PRINT_FRAME
// EXPRESSION: element
// RESULT: 1.0: D
// EXPRESSION: this.prop
// RESULT: 1: I
frame = main:14, FrameInlineFunKt {frameInlineFun} frame = main:14, FrameInlineFunKt {frameInlineFun}
local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = null) local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = null)
local = element: int = 1 (sp = frameInlineFun.kt, 12) local = element: int = 1 (sp = frameInlineFun.kt, 12)
@@ -6,53 +6,6 @@ frameInlineFunCallInsideInlineFun.kt:5
frameInlineFunCallInsideInlineFun.kt:6 frameInlineFunCallInsideInlineFun.kt:6
Compile bytecode for element Compile bytecode for element
Compile bytecode for this.prop Compile bytecode for this.prop
package frameInlineFunCallInsideInlineFun
class A {
inline fun inlineFun(s: (Int) -> Unit) {
val element = 1.0
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:6, C {frameInlineFunCallInsideInlineFun} frame = bar:6, C {frameInlineFunCallInsideInlineFun}
this = this = {frameInlineFunCallInsideInlineFun.C@uniqueID} this = this = {frameInlineFunCallInsideInlineFun.C@uniqueID}
- Class has no fields - Class has no fields
@@ -6,55 +6,6 @@ frameInlineFunCallInsideInlineFunKotlinVariables.kt:7
frameInlineFunCallInsideInlineFunKotlinVariables.kt:8 frameInlineFunCallInsideInlineFunKotlinVariables.kt:8
Compile bytecode for element Compile bytecode for element
Compile bytecode for this.prop Compile bytecode for this.prop
// SHOW_KOTLIN_VARIABLES
package frameInlineFunCallInsideInlineFunKotlinVariables
class A {
inline fun inlineFun(s: (Int) -> Unit) {
val element = 1.0
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:8, C {frameInlineFunCallInsideInlineFunKotlinVariables} frame = bar:8, C {frameInlineFunCallInsideInlineFunKotlinVariables}
this = this = {frameInlineFunCallInsideInlineFunKotlinVariables.C@uniqueID} this = this = {frameInlineFunCallInsideInlineFunKotlinVariables.C@uniqueID}
- Class has no fields - Class has no fields
@@ -6,40 +6,6 @@ Compile bytecode for prop1
Compile bytecode for prop2 Compile bytecode for prop2
Compile bytecode for myFun1() Compile bytecode for myFun1()
Compile bytecode for myFun2() Compile bytecode for myFun2()
package frameInnerClass
fun main(args: Array<String>) {
A().Inner().test()
}
class A {
val prop1 = 1
fun myFun1() = 1
inner class Inner {
val prop2 = 1
fun myFun2() = 1
fun test() {
//Breakpoint!
prop1 + prop2
}
}
}
// PRINT_FRAME
// EXPRESSION: prop1
// RESULT: 1: I
// EXPRESSION: prop2
// RESULT: 1: I
// EXPRESSION: myFun1()
// RESULT: 1: I
// EXPRESSION: myFun2()
// RESULT: 1: I
frame = test:17, A$Inner {frameInnerClass} frame = test:17, A$Inner {frameInnerClass}
this = this = {frameInnerClass.A$Inner@uniqueID} this = this = {frameInnerClass.A$Inner@uniqueID}
field = prop2: int = 1 (sp = frameInnerClass.kt, 12) field = prop2: int = 1 (sp = frameInnerClass.kt, 12)
@@ -5,33 +5,6 @@ frameInnerLambda.kt:9
Compile bytecode for val1 Compile bytecode for val1
Compile bytecode for val2 Compile bytecode for val2
Compile bytecode for val1 + val2 Compile bytecode for val1 + val2
package frameInnerLambda
fun main(args: Array<String>) {
val val1 = 1
foo {
val val2 = 1
foo {
//Breakpoint!
val1 + val2
}
}
}
fun foo(f: () -> Unit) {
f()
}
// PRINT_FRAME
// EXPRESSION: val1
// RESULT: 1: I
// EXPRESSION: val2
// RESULT: 1: I
// EXPRESSION: val1 + val2
// RESULT: 2: I
frame = invoke:9, FrameInnerLambdaKt$main$1$1 {frameInnerLambda} frame = invoke:9, FrameInnerLambdaKt$main$1$1 {frameInnerLambda}
this = this = {frameInnerLambda.FrameInnerLambdaKt$main$1$1@uniqueID}Function0<kotlin.Unit> this = this = {frameInnerLambda.FrameInnerLambdaKt$main$1$1@uniqueID}Function0<kotlin.Unit>
field = this$0: frameInnerLambda.FrameInnerLambdaKt$main$1 = {frameInnerLambda.FrameInnerLambdaKt$main$1@uniqueID}Function0<kotlin.Unit> (sp = null) field = this$0: frameInnerLambda.FrameInnerLambdaKt$main$1 = {frameInnerLambda.FrameInnerLambdaKt$main$1@uniqueID}Function0<kotlin.Unit> (sp = null)
@@ -3,24 +3,6 @@ Run Java
Connected to the target VM Connected to the target VM
frameLambda.kt:7 frameLambda.kt:7
Compile bytecode for val1 Compile bytecode for val1
package frameLambda
fun main(args: Array<String>) {
val val1 = 1
foo {
//Breakpoint!
val1
}
}
fun foo(f: () -> Unit) {
f()
}
// PRINT_FRAME
// EXPRESSION: val1
// RESULT: 1: I
frame = invoke:7, FrameLambdaKt$main$1 {frameLambda} frame = invoke:7, FrameLambdaKt$main$1 {frameLambda}
this = this = {frameLambda.FrameLambdaKt$main$1@uniqueID}Function0<kotlin.Unit> this = this = {frameLambda.FrameLambdaKt$main$1@uniqueID}Function0<kotlin.Unit>
field = $val1: int = 1 (sp = null) field = $val1: int = 1 (sp = null)
@@ -3,24 +3,6 @@ Run Java
Connected to the target VM Connected to the target VM
frameLambdaNotUsed.kt:7 frameLambdaNotUsed.kt:7
Compile bytecode for val1 Compile bytecode for val1
package frameLambdaNotUsed
fun main(args: Array<String>) {
val val1 = 1
foo {
//Breakpoint!
val a = 1
}
}
fun foo(f: () -> Unit) {
f()
}
// PRINT_FRAME
// EXPRESSION: val1
// RESULT: 'val1' is not captured
frame = invoke:7, FrameLambdaNotUsedKt$main$1 {frameLambdaNotUsed} frame = invoke:7, FrameLambdaNotUsedKt$main$1 {frameLambdaNotUsed}
this = this = {frameLambdaNotUsed.FrameLambdaNotUsedKt$main$1@uniqueID}Function0<kotlin.Unit> this = this = {frameLambdaNotUsed.FrameLambdaNotUsedKt$main$1@uniqueID}Function0<kotlin.Unit>
field = arity: int = 0 (sp = Lambda.!EXT!) field = arity: int = 0 (sp = Lambda.!EXT!)
@@ -2,15 +2,6 @@ LineBreakpoint created at frameLocalVariable.kt:6
Run Java Run Java
Connected to the target VM Connected to the target VM
frameLocalVariable.kt:6 frameLocalVariable.kt:6
package frameLocalVariable
fun main(args: Array<String>) {
val val1 = 1
//Breakpoint!
val val2 = 1
}
// PRINT_FRAME
frame = main:6, FrameLocalVariableKt {frameLocalVariable} frame = main:6, FrameLocalVariableKt {frameLocalVariable}
local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = frameLocalVariable.kt, 3) local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = frameLocalVariable.kt, 3)
local = val1: int = 1 (sp = frameLocalVariable.kt, 4) local = val1: int = 1 (sp = frameLocalVariable.kt, 4)
@@ -4,31 +4,6 @@ Connected to the target VM
frameObject.kt:6 frameObject.kt:6
Compile bytecode for O.obProp Compile bytecode for O.obProp
Compile bytecode for O.obMyFun() Compile bytecode for O.obMyFun()
package frameObject
fun main(args: Array<String>) {
foo {
//Breakpoint!
O.obProp
}
}
object O {
val obProp = 1
fun obMyFun() = 1
}
fun foo(f: () -> Unit) {
f()
}
// PRINT_FRAME
// EXPRESSION: O.obProp
// RESULT: 1: I
// EXPRESSION: O.obMyFun()
// RESULT: 1: I
frame = invoke:6, FrameObjectKt$main$1 {frameObject} frame = invoke:6, FrameObjectKt$main$1 {frameObject}
this = this = {frameObject.FrameObjectKt$main$1@uniqueID}Function0<kotlin.Unit> this = this = {frameObject.FrameObjectKt$main$1@uniqueID}Function0<kotlin.Unit>
field = arity: int = 0 (sp = Lambda.!EXT!) field = arity: int = 0 (sp = Lambda.!EXT!)
@@ -3,24 +3,6 @@ Run Java
Connected to the target VM Connected to the target VM
frameSharedVar.kt:7 frameSharedVar.kt:7
Compile bytecode for var1 Compile bytecode for var1
package frameSharedVar
fun main(args: Array<String>) {
var var1 = 1
foo {
//Breakpoint!
var1 = 2
}
}
fun foo(f: () -> Unit) {
f()
}
// PRINT_FRAME
// EXPRESSION: var1
// RESULT: 1: I
frame = invoke:7, FrameSharedVarKt$main$1 {frameSharedVar} frame = invoke:7, FrameSharedVarKt$main$1 {frameSharedVar}
this = this = {frameSharedVar.FrameSharedVarKt$main$1@uniqueID}Function0<kotlin.Unit> this = this = {frameSharedVar.FrameSharedVarKt$main$1@uniqueID}Function0<kotlin.Unit>
field = $var1: kotlin.jvm.internal.Ref$IntRef = {kotlin.jvm.internal.Ref$IntRef@uniqueID}1 (sp = null) field = $var1: kotlin.jvm.internal.Ref$IntRef = {kotlin.jvm.internal.Ref$IntRef@uniqueID}1 (sp = null)
@@ -3,24 +3,6 @@ Run Java
Connected to the target VM Connected to the target VM
frameSharedVarLocalVar.kt:7 frameSharedVarLocalVar.kt:7
Compile bytecode for var1 Compile bytecode for var1
package frameSharedVarLocalVar
fun main(args: Array<String>) {
var var1 = 1
foo {
//Breakpoint!
var1 = 2
}
}
inline fun foo(f: () -> Unit) {
f()
}
// PRINT_FRAME
// EXPRESSION: var1
// RESULT: 1: I
frame = main:7, FrameSharedVarLocalVarKt {frameSharedVarLocalVar} frame = main:7, FrameSharedVarLocalVarKt {frameSharedVarLocalVar}
local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = frameSharedVarLocalVar.kt, 3) local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = frameSharedVarLocalVar.kt, 3)
local = var1: int = 1 (sp = frameSharedVarLocalVar.kt, 4) local = var1: int = 1 (sp = frameSharedVarLocalVar.kt, 4)
@@ -6,32 +6,6 @@ Compile bytecode for val1
Compile bytecode for val2 Compile bytecode for val2
Compile bytecode for topVal1 Compile bytecode for topVal1
Compile bytecode for val1 + topVal1 Compile bytecode for val1 + topVal1
package frameSimple
val topVal1 = 1
fun main(args: Array<String>) {
val val1 = 1
val val2 = MyClass()
//Breakpoint!
val1 + topVal1
}
class MyClass
// PRINT_FRAME
// EXPRESSION: val1
// RESULT: 1: I
// EXPRESSION: val2
// RESULT: instance of frameSimple.MyClass(id=ID): LframeSimple/MyClass;
// EXPRESSION: topVal1
// RESULT: 1: I
// EXPRESSION: val1 + topVal1
// RESULT: 2: I
frame = main:9, FrameSimpleKt {frameSimple} frame = main:9, FrameSimpleKt {frameSimple}
static = static = frameSimple.FrameSimpleKt static = static = frameSimple.FrameSimpleKt
field = topVal1: int = 1 (sp = frameSimple.kt, 3) field = topVal1: int = 1 (sp = frameSimple.kt, 3)
@@ -7,46 +7,6 @@ Compile bytecode for val2
Compile bytecode for prop1 Compile bytecode for prop1
Compile bytecode for prop1 + val1 + val2 Compile bytecode for prop1 + val1 + val2
Compile bytecode for myFun() Compile bytecode for myFun()
package frameThis0
fun main(args: Array<String>) {
A().test()
}
class A {
val prop1 = 1
fun myFun() = 1
fun test() {
val val1 = 1
foo {
val val2 = 1
//Breakpoint!
prop1 + val1 + val2
}
}
}
fun foo(f: () -> Unit) {
f()
}
// PRINT_FRAME
// EXPRESSION: val1
// RESULT: 1: I
// EXPRESSION: val2
// RESULT: 1: I
// EXPRESSION: prop1
// RESULT: 1: I
// EXPRESSION: prop1 + val1 + val2
// RESULT: 3: I
// EXPRESSION: myFun()
// RESULT: 1: I
frame = invoke:16, A$test$1 {frameThis0} frame = invoke:16, A$test$1 {frameThis0}
this = this = {frameThis0.A$test$1@uniqueID}Function0<kotlin.Unit> this = this = {frameThis0.A$test$1@uniqueID}Function0<kotlin.Unit>
field = this$0: frameThis0.A = {frameThis0.A@uniqueID} (sp = null) field = this$0: frameThis0.A = {frameThis0.A@uniqueID} (sp = null)
@@ -9,60 +9,6 @@ Compile bytecode for prop1 + val1
Compile bytecode for prop2 + val1 Compile bytecode for prop2 + val1
Compile bytecode for myFun1() Compile bytecode for myFun1()
Compile bytecode for myFun2() Compile bytecode for myFun2()
package frameThis0Ext
fun main(args: Array<String>) {
A().test()
}
class A {
val prop1 = 1
fun myFun1() = 1
fun AExt.testExt() {
val val1 = 1
foo {
//Breakpoint!
prop1 + prop2 + val1
}
}
fun test() {
AExt().testExt()
}
}
class AExt {
val prop2 = 1
fun myFun2() = 1
}
fun foo(f: () -> Unit) {
f()
}
// PRINT_FRAME
// EXPRESSION: val1
// RESULT: 1: I
// EXPRESSION: prop1
// RESULT: 1: I
// EXPRESSION: prop2
// RESULT: 1: I
// EXPRESSION: prop1 + val1
// RESULT: 2: I
// EXPRESSION: prop2 + val1
// RESULT: 2: I
// EXPRESSION: myFun1()
// RESULT: 1: I
// EXPRESSION: myFun2()
// RESULT: 1: I
frame = invoke:15, A$testExt$1 {frameThis0Ext} frame = invoke:15, A$testExt$1 {frameThis0Ext}
this = this = {frameThis0Ext.A$testExt$1@uniqueID}Function0<kotlin.Unit> this = this = {frameThis0Ext.A$testExt$1@uniqueID}Function0<kotlin.Unit>
field = this$0: frameThis0Ext.A = {frameThis0Ext.A@uniqueID} (sp = null) field = this$0: frameThis0Ext.A = {frameThis0Ext.A@uniqueID} (sp = null)
@@ -7,48 +7,6 @@ Compile bytecode for val2
Compile bytecode for prop1 Compile bytecode for prop1
Compile bytecode for prop1 + val1 + val2 Compile bytecode for prop1 + val1 + val2
Compile bytecode for myFun() Compile bytecode for myFun()
package frameThis0This0
fun main(args: Array<String>) {
A().test()
}
class A {
val prop1 = 1
fun myFun() = 1
fun test() {
val val1 = 1
foo {
val val2 = 1
foo {
//Breakpoint!
prop1 + val1 + val2
}
}
}
}
fun foo(f: () -> Unit) {
f()
}
// PRINT_FRAME
// EXPRESSION: val1
// RESULT: 1: I
// EXPRESSION: val2
// RESULT: 1: I
// EXPRESSION: prop1
// RESULT: 1: I
// EXPRESSION: prop1 + val1 + val2
// RESULT: 3: I
// EXPRESSION: myFun()
// RESULT: 1: I
frame = invoke:17, A$test$1$1 {frameThis0This0} frame = invoke:17, A$test$1$1 {frameThis0This0}
this = this = {frameThis0This0.A$test$1$1@uniqueID}Function0<kotlin.Unit> this = this = {frameThis0This0.A$test$1$1@uniqueID}Function0<kotlin.Unit>
field = this$0: frameThis0This0.A$test$1 = {frameThis0This0.A$test$1@uniqueID}Function0<kotlin.Unit> (sp = null) field = this$0: frameThis0This0.A$test$1 = {frameThis0This0.A$test$1@uniqueID}Function0<kotlin.Unit> (sp = null)
@@ -2,19 +2,6 @@ LineBreakpoint created at hideContinuationThis.kt:9
Run Java Run Java
Connected to the target VM Connected to the target VM
hideContinuationThis.kt:9 hideContinuationThis.kt:9
package hideContinuationThis
suspend fun main() {
foo()
}
var foo: suspend () -> Unit = {
//Breakpoint!
val a = 5
}
// PRINT_FRAME
// SHOW_KOTLIN_VARIABLES
frame = invokeSuspend:9, HideContinuationThisKt$foo$1 {hideContinuationThis} frame = invokeSuspend:9, HideContinuationThisKt$foo$1 {hideContinuationThis}
local = result: java.lang.Object = {kotlin.Unit@uniqueID}kotlin.Unit (sp = null) local = result: java.lang.Object = {kotlin.Unit@uniqueID}kotlin.Unit (sp = null)
- No fields to display - No fields to display
@@ -2,22 +2,6 @@ LineBreakpoint created at hideSyntheticThis.kt:6
Run Java Run Java
Connected to the target VM Connected to the target VM
hideSyntheticThis.kt:6 hideSyntheticThis.kt:6
package hideSyntheticThis
fun main() {
block("foo") {
//Breakpoint!
val b = 4
}
}
fun <T> block(t: T, block: T.() -> Unit) {
t.block()
}
// PRINT_FRAME
// SHOW_KOTLIN_VARIABLES
// DESCRIPTOR_VIEW_OPTIONS: NAME_EXPRESSION
frame = invoke frame = invoke
local = this (expression = this) local = this (expression = this)
field = value (expression = this.value) field = value (expression = this.value)
@@ -2,26 +2,6 @@ LineBreakpoint created at remapThis.kt:14
Run Java Run Java
Connected to the target VM Connected to the target VM
remapThis.kt:14 remapThis.kt:14
package remapThis
fun main() {
Bar().bar()
}
class Bar {
fun bar() {
"a".foo()
}
fun String.foo() {
//Breakpoint!
val a = this
}
}
// PRINT_FRAME
// SHOW_KOTLIN_VARIABLES
// DESCRIPTOR_VIEW_OPTIONS: NAME_EXPRESSION
frame = foo frame = foo
this = this (@Bar) (expression = this) this = this (@Bar) (expression = this)
- -
@@ -3,22 +3,6 @@ Run Java
Connected to the target VM Connected to the target VM
suspendContinuation.kt:7 suspendContinuation.kt:7
Compile bytecode for a Compile bytecode for a
package suspendContinuation
suspend fun main() {
val a = 5
foo()
//Breakpoint!
val b = 4
}
suspend fun foo() {}
// PRINT_FRAME
// SHOW_KOTLIN_VARIABLES
// EXPRESSION: a
// RESULT: 5: I
frame = main:7, SuspendContinuationKt {suspendContinuation} frame = main:7, SuspendContinuationKt {suspendContinuation}
local = $continuation: kotlin.coroutines.Continuation = {suspendContinuation.SuspendContinuationKt$main$1@uniqueID}Continuation at suspendContinuation.SuspendContinuationKt.main(suspendContinuation.kt:5) (sp = null) local = $continuation: kotlin.coroutines.Continuation = {suspendContinuation.SuspendContinuationKt$main$1@uniqueID}Continuation at suspendContinuation.SuspendContinuationKt.main(suspendContinuation.kt:5) (sp = null)
field = result: java.lang.Object = null (sp = null) field = result: java.lang.Object = null (sp = null)
@@ -4,28 +4,6 @@ Connected to the target VM
destructuringParam.kt:12 destructuringParam.kt:12
Compile bytecode for x Compile bytecode for x
Compile bytecode for y Compile bytecode for y
package destructuringParam
data class A(val x: String, val y: String)
fun foo(a: A, block: (A) -> String): String = block(a)
fun box() {
}
fun main(args: Array<String>) {
//Breakpoint! (lambdaOrdinal = 1)
foo(A("O", "K")) { (x, y) -> x + y }
}
// PRINT_FRAME
// EXPRESSION: x
// RESULT: "O": Ljava/lang/String;
// EXPRESSION: y
// RESULT: "K": Ljava/lang/String;
frame = invoke:12, DestructuringParamKt$main$1 {destructuringParam} frame = invoke:12, DestructuringParamKt$main$1 {destructuringParam}
this = this = {destructuringParam.DestructuringParamKt$main$1@uniqueID}Function1<destructuringParam.A, java.lang.String> this = this = {destructuringParam.DestructuringParamKt$main$1@uniqueID}Function1<destructuringParam.A, java.lang.String>
field = arity: int = 1 (sp = Lambda.!EXT!) field = arity: int = 1 (sp = Lambda.!EXT!)
@@ -4,39 +4,6 @@ Connected to the target VM
underscoreNames.kt:18 underscoreNames.kt:18
Compile bytecode for x Compile bytecode for x
Compile bytecode for y Compile bytecode for y
package underscoreNames
data class A(val x: Double = 1.0, val y: String = "", val z: Char = '0')
fun foo(a: A, block: (A, String, Int) -> String): String = block(a, "", 1)
val arrayOfA: Array<A> = Array(1) { A() }
fun main(args: Array<String>) {
foo(A()) {
(x, _, y), _, w ->
val (a, _, c) = A()
val (_, `_`, d) = A()
for ((_, q) in arrayOfA) {
//Breakpoint! (lambdaOrdinal = 1)
println(q)
}
""
}
}
// PRINT_FRAME
// EXPRESSION: x
// RESULT: 1.0: D
// EXPRESSION: y
// RESULT: 48: C
Compile bytecode for arrayOfA Compile bytecode for arrayOfA
frame = invoke:18, UnderscoreNamesKt$main$1 {underscoreNames} frame = invoke:18, UnderscoreNamesKt$main$1 {underscoreNames}
this = this = {underscoreNames.UnderscoreNamesKt$main$1@uniqueID}Function3<underscoreNames.A, java.lang.String, java.lang.Integer, java.lang.String> this = this = {underscoreNames.UnderscoreNamesKt$main$1@uniqueID}Function3<underscoreNames.A, java.lang.String, java.lang.Integer, java.lang.String>
@@ -2,19 +2,6 @@ LineBreakpoint created at toStringRenderer.kt:6
Run Java Run Java
Connected to the target VM Connected to the target VM
toStringRenderer.kt:6 toStringRenderer.kt:6
package toStringRenderer
fun main(args: Array<String>) {
val a = A()
//Breakpoint!
args.size
}
class A {
override fun toString() = "myA"
}
// PRINT_FRAME
Compile bytecode for args.size Compile bytecode for args.size
frame = main:6, ToStringRendererKt {toStringRenderer} frame = main:6, ToStringRendererKt {toStringRenderer}
local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = toStringRenderer.kt, 3) local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = toStringRenderer.kt, 3)
@@ -106,12 +106,6 @@ abstract class AbstractKotlinEvaluateExpressionTest : KotlinDebuggerTestBase() {
configureSettings(fileText) configureSettings(fileText)
createAdditionalBreakpoints(fileText) createAdditionalBreakpoints(fileText)
val shouldPrintFrame = isDirectiveDefined(fileText, "// PRINT_FRAME")
val skipInPrintFrame = if (shouldPrintFrame) findListWithPrefixes(fileText, "// SKIP: ") else emptyList()
val descriptorViewOptions = DescriptorViewOptions.valueOf(findStringWithPrefixes(fileText, "// DESCRIPTOR_VIEW_OPTIONS: ") ?: "FULL")
ToggleKotlinVariablesState.getService().kotlinVariableView = isDirectiveDefined(fileText, "// SHOW_KOTLIN_VARIABLES")
val expressions = loadTestDirectivesPairs(fileText, "// EXPRESSION: ", "// RESULT: ") val expressions = loadTestDirectivesPairs(fileText, "// EXPRESSION: ", "// RESULT: ")
val blocks = findFilesWithBlocks(file).map { FileUtil.loadFile(it, true) } val blocks = findFilesWithBlocks(file).map { FileUtil.loadFile(it, true) }
@@ -119,16 +113,10 @@ abstract class AbstractKotlinEvaluateExpressionTest : KotlinDebuggerTestBase() {
createDebugProcess(path) createDebugProcess(path)
val printFrameHandler = PrintFrameHandler(fileText)
doStepping(path) doStepping(path)
var variablesView: XVariablesView? = null
var watchesView: XWatchesViewImpl? = null
ApplicationManager.getApplication().invokeAndWait({
variablesView = createVariablesView()
watchesView = createWatchesView()
}, ModalityState.any())
doOnBreakpoint { doOnBreakpoint {
val exceptions = linkedMapOf<String, Throwable>() val exceptions = linkedMapOf<String, Throwable>()
try { try {
@@ -145,15 +133,8 @@ abstract class AbstractKotlinEvaluateExpressionTest : KotlinDebuggerTestBase() {
evaluate(block, CodeFragmentKind.CODE_BLOCK, expectedBlockResults[i]) evaluate(block, CodeFragmentKind.CODE_BLOCK, expectedBlockResults[i])
} }
} }
} } finally {
finally { printFrameHandler.trigger(this@doOnBreakpoint)
if (shouldPrintFrame) {
printFrame(variablesView!!, watchesView!!, PrinterConfig(skipInPrintFrame, descriptorViewOptions))
println(fileText, ProcessOutputTypes.SYSTEM)
}
else {
resume(this)
}
} }
checkExceptions(exceptions) checkExceptions(exceptions)
@@ -170,6 +151,8 @@ abstract class AbstractKotlinEvaluateExpressionTest : KotlinDebuggerTestBase() {
createDebugProcess(path) createDebugProcess(path)
val printFrameHandler = PrintFrameHandler(fileText)
val expressions = loadTestDirectivesPairs(fileText, "// EXPRESSION: ", "// RESULT: ") val expressions = loadTestDirectivesPairs(fileText, "// EXPRESSION: ", "// RESULT: ")
val exceptions = linkedMapOf<String, Throwable>() val exceptions = linkedMapOf<String, Throwable>()
@@ -178,19 +161,52 @@ abstract class AbstractKotlinEvaluateExpressionTest : KotlinDebuggerTestBase() {
doOnBreakpoint { doOnBreakpoint {
try { try {
evaluate(expression, CodeFragmentKind.EXPRESSION, expected) evaluate(expression, CodeFragmentKind.EXPRESSION, expected)
} } finally {
finally { printFrameHandler.trigger(this@doOnBreakpoint)
resume(this)
} }
} }
} }
} }
checkExceptions(exceptions) checkExceptions(exceptions)
finish() finish()
} }
private inner class PrintFrameHandler(fileText: String) {
private val shouldPrintFrame = isDirectiveDefined(fileText, "// PRINT_FRAME")
private val skipInPrintFrame = if (shouldPrintFrame) findListWithPrefixes(fileText, "// SKIP: ") else emptyList()
private val descriptorViewOptions =
DescriptorViewOptions.valueOf(findStringWithPrefixes(fileText, "// DESCRIPTOR_VIEW_OPTIONS: ") ?: "FULL")
private val kotlinVariablesState: ToggleKotlinVariablesState
private val oldKotlinVariablesState: Boolean
private lateinit var variablesView: XVariablesView
private lateinit var watchesView: XWatchesViewImpl
init {
ApplicationManager.getApplication().invokeAndWait(
{
variablesView = createVariablesView()
watchesView = createWatchesView()
}, ModalityState.any()
)
kotlinVariablesState = ToggleKotlinVariablesState.getService()
oldKotlinVariablesState = kotlinVariablesState.kotlinVariableView
kotlinVariablesState.kotlinVariableView = isDirectiveDefined(fileText, "// SHOW_KOTLIN_VARIABLES")
}
fun trigger(suspendContext: SuspendContextImpl) {
if (shouldPrintFrame) {
suspendContext.printFrame(variablesView, watchesView, PrinterConfig(skipInPrintFrame, descriptorViewOptions))
} else {
resume(suspendContext)
}
}
}
private fun createWatchesView(): XWatchesViewImpl { private fun createWatchesView(): XWatchesViewImpl {
val session = myDebuggerSession.xDebugSession as XDebugSessionImpl val session = myDebuggerSession.xDebugSession as XDebugSessionImpl
val watchesView = XWatchesViewImpl(session, false) val watchesView = XWatchesViewImpl(session, false)