Debugger: remove usage of JDIEval during finding local variable in frame because it invokeMethod (loadClass) for find field type which invalidates frame

This commit is contained in:
Natalia Ukhorskaya
2015-02-06 15:25:33 +03:00
parent 3802957c15
commit 187806d061
17 changed files with 153 additions and 43 deletions
@@ -1,8 +1,9 @@
LineBreakpoint created at frameClassObject.kt:15
LineBreakpoint created at frameClassObject.kt:16
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!CUSTOM_LIBRARY!;!RT_JAR! frameClassObject.FrameClassObjectPackage
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
frameClassObject.kt:15
frameClassObject.kt:16
Compile bytecode for prop
Compile bytecode for myFun()
package frameClassObject
fun main(args: Array<String>) {
@@ -12,6 +13,7 @@ fun main(args: Array<String>) {
class A {
class object {
val prop = 1
fun myFun() = 1
}
fun test() {
@@ -30,7 +32,10 @@ fun foo(f: () -> Unit) {
// EXPRESSION: prop
// RESULT: 1: I
frame = invoke():15, A$test$1 {frameClassObject}
// EXPRESSION: myFun()
// RESULT: 1: I
frame = invoke():16, A$test$1 {frameClassObject}
this = this = {frameClassObject.A$test$1@uniqueID}kotlin.Function0<kotlin.Unit>
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
@@ -1,12 +1,15 @@
LineBreakpoint created at frameExtFunExtFun.kt:22
LineBreakpoint created at frameExtFunExtFun.kt:24
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!CUSTOM_LIBRARY!;!RT_JAR! frameExtFunExtFun.FrameExtFunExtFunPackage
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
frameExtFunExtFun.kt:22
frameExtFunExtFun.kt:24
Compile bytecode for valFoo
Compile bytecode for valTest
Compile bytecode for aProp
Compile bytecode for outerProp
Compile bytecode for bProp
Compile bytecode for aMyFun()
Compile bytecode for outerMyFun()
Compile bytecode for bMyFun()
package frameExtFunExtFun
fun main(args: Array<String>) {
@@ -15,10 +18,12 @@ fun main(args: Array<String>) {
class A {
val aProp = 1
fun aMyFun() = 1
}
class Outer {
val outerProp = 1
fun outerMyFun() = 1
fun A.foo() {
val valFoo = 1
@@ -46,6 +51,7 @@ class Outer {
class B {
val bProp = 1
fun bMyFun() = 1
}
fun lambda(f: () -> Unit) {
@@ -68,17 +74,26 @@ fun lambda(f: () -> Unit) {
// EXPRESSION: bProp
// RESULT: 1: I
frame = invoke():22, Outer$foo$LocalClass$test$1 {frameExtFunExtFun}
// EXPRESSION: aMyFun()
// RESULT: 1: I
// EXPRESSION: outerMyFun()
// RESULT: 1: I
// EXPRESSION: bMyFun()
// RESULT: 1: I
frame = invoke():24, Outer$foo$LocalClass$test$1 {frameExtFunExtFun}
this = this = {frameExtFunExtFun.Outer$foo$LocalClass$test$1@uniqueID}kotlin.Function0<kotlin.Unit>
field = this$0: frameExtFunExtFun.Outer$foo$LocalClass = {frameExtFunExtFun.Outer$foo$LocalClass@uniqueID} (sp = null)
field = lcProp: int = 1 (sp = frameExtFunExtFun.kt, 17)
field = lcProp: int = 1 (sp = frameExtFunExtFun.kt, 19)
field = this$0: frameExtFunExtFun.Outer = {frameExtFunExtFun.Outer@uniqueID} (sp = null)
field = outerProp: int = 1 (sp = frameExtFunExtFun.kt, 12)
field = outerProp: int = 1 (sp = frameExtFunExtFun.kt, 13)
field = receiver$0: frameExtFunExtFun.A = {frameExtFunExtFun.A@uniqueID} (sp = null)
field = aProp: int = 1 (sp = frameExtFunExtFun.kt, 8)
field = $valFoo: int = 1 (sp = null)
field = receiver$0: frameExtFunExtFun.B = {frameExtFunExtFun.B@uniqueID} (sp = null)
field = bProp: int = 1 (sp = frameExtFunExtFun.kt, 39)
field = bProp: int = 1 (sp = frameExtFunExtFun.kt, 41)
field = $valTest: int = 1 (sp = null)
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
@@ -1,8 +1,9 @@
LineBreakpoint created at frameExtensionFun.kt:13
LineBreakpoint created at frameExtensionFun.kt:14
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!CUSTOM_LIBRARY!;!RT_JAR! frameExtensionFun.FrameExtensionFunPackage
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
frameExtensionFun.kt:13
frameExtensionFun.kt:14
Compile bytecode for prop
Compile bytecode for myFun()
package frameExtensionFun
fun main(args: Array<String>) {
@@ -11,6 +12,7 @@ fun main(args: Array<String>) {
class A {
val prop = 1
fun myFun() = 1
}
fun A.foo() {
@@ -22,7 +24,10 @@ fun A.foo() {
// EXPRESSION: prop
// RESULT: 1: I
frame = foo():13, FrameExtensionFunPackage$@packagePartHASH {frameExtensionFun}
// EXPRESSION: myFun()
// RESULT: 1: I
frame = foo():14, FrameExtensionFunPackage$@packagePartHASH {frameExtensionFun}
static = static = frameExtensionFun.FrameExtensionFunPackage$@packagePartHASH
local = $receiver: frameExtensionFun.A = {frameExtensionFun.A@uniqueID} (sp = null)
field = prop: int = 1 (sp = frameExtensionFun.kt, 8)
@@ -1,9 +1,11 @@
LineBreakpoint created at frameInnerClass.kt:15
LineBreakpoint created at frameInnerClass.kt:17
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!CUSTOM_LIBRARY!;!RT_JAR! frameInnerClass.FrameInnerClassPackage
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
frameInnerClass.kt:15
frameInnerClass.kt:17
Compile bytecode for prop1
Compile bytecode for prop2
Compile bytecode for myFun1()
Compile bytecode for myFun2()
package frameInnerClass
fun main(args: Array<String>) {
@@ -12,9 +14,11 @@ fun main(args: Array<String>) {
class A {
val prop1 = 1
fun myFun1() = 1
inner class Inner {
val prop2 = 1
fun myFun2() = 1
fun test() {
//Breakpoint!
@@ -30,9 +34,15 @@ class A {
// EXPRESSION: prop2
// RESULT: 1: I
frame = test():15, A$Inner {frameInnerClass}
// EXPRESSION: myFun1()
// RESULT: 1: I
// EXPRESSION: myFun2()
// RESULT: 1: I
frame = test():17, A$Inner {frameInnerClass}
this = this = {frameInnerClass.A$Inner@uniqueID}
field = prop2: int = 1 (sp = frameInnerClass.kt, 11)
field = prop2: int = 1 (sp = frameInnerClass.kt, 12)
field = this$0: frameInnerClass.A = {frameInnerClass.A@uniqueID} (sp = null)
field = prop1: int = 1 (sp = frameInnerClass.kt, 8)
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
@@ -3,6 +3,7 @@ LineBreakpoint created at frameObject.kt:6
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
frameObject.kt:6
Compile bytecode for O.obProp
Compile bytecode for O.obMyFun()
package frameObject
fun main(args: Array<String>) {
@@ -14,6 +15,7 @@ fun main(args: Array<String>) {
object O {
val obProp = 1
fun obMyFun() = 1
}
fun foo(f: () -> Unit) {
@@ -23,6 +25,9 @@ fun foo(f: () -> Unit) {
// PRINT_FRAME
// EXPRESSION: O.obProp
// RESULT: 1: I
// EXPRESSION: O.obMyFun()
// RESULT: 1: I
frame = invoke():6, FrameObjectPackage$@packagePartHASH$main$1 {frameObject}
this = this = {frameObject.FrameObjectPackage$@packagePartHASH$main$1@uniqueID}kotlin.Function0<kotlin.Unit>
@@ -1,11 +1,12 @@
LineBreakpoint created at frameThis0.kt:15
LineBreakpoint created at frameThis0.kt:16
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!CUSTOM_LIBRARY!;!RT_JAR! frameThis0.FrameThis0Package
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
frameThis0.kt:15
frameThis0.kt:16
Compile bytecode for val1
Compile bytecode for val2
Compile bytecode for prop1
Compile bytecode for prop1 + val1 + val2
Compile bytecode for myFun()
package frameThis0
fun main(args: Array<String>) {
@@ -14,6 +15,7 @@ fun main(args: Array<String>) {
class A {
val prop1 = 1
fun myFun() = 1
fun test() {
val val1 = 1
@@ -42,12 +44,15 @@ fun foo(f: () -> Unit) {
// EXPRESSION: prop1 + val1 + val2
// RESULT: 3: I
frame = invoke():15, A$test$1 {frameThis0}
// EXPRESSION: myFun()
// RESULT: 1: I
frame = invoke():16, A$test$1 {frameThis0}
this = this = {frameThis0.A$test$1@uniqueID}kotlin.Function0<kotlin.Unit>
field = this$0: frameThis0.A = {frameThis0.A@uniqueID} (sp = null)
field = prop1: int = 1 (sp = frameThis0.kt, 8)
field = $val1: int = 1 (sp = null)
local = val2: int = 1 (sp = frameThis0.kt, 13)
local = val2: int = 1 (sp = frameThis0.kt, 14)
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
Process finished with exit code 0
@@ -1,12 +1,14 @@
LineBreakpoint created at frameThis0Ext.kt:14
LineBreakpoint created at frameThis0Ext.kt:15
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!CUSTOM_LIBRARY!;!RT_JAR! frameThis0Ext.FrameThis0ExtPackage
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
frameThis0Ext.kt:14
frameThis0Ext.kt:15
Compile bytecode for val1
Compile bytecode for prop1
Compile bytecode for prop2
Compile bytecode for prop1 + val1
Compile bytecode for prop2 + val1
Compile bytecode for myFun1()
Compile bytecode for myFun2()
package frameThis0Ext
fun main(args: Array<String>) {
@@ -15,6 +17,7 @@ fun main(args: Array<String>) {
class A {
val prop1 = 1
fun myFun1() = 1
fun AExt.testExt() {
val val1 = 1
@@ -31,6 +34,7 @@ class A {
class AExt {
val prop2 = 1
fun myFun2() = 1
}
fun foo(f: () -> Unit) {
@@ -53,12 +57,18 @@ fun foo(f: () -> Unit) {
// EXPRESSION: prop2 + val1
// RESULT: 2: I
frame = invoke():14, A$testExt$1 {frameThis0Ext}
// EXPRESSION: myFun1()
// RESULT: 1: I
// EXPRESSION: myFun2()
// RESULT: 1: I
frame = invoke():15, A$testExt$1 {frameThis0Ext}
this = this = {frameThis0Ext.A$testExt$1@uniqueID}kotlin.Function0<kotlin.Unit>
field = this$0: frameThis0Ext.A = {frameThis0Ext.A@uniqueID} (sp = null)
field = prop1: int = 1 (sp = frameThis0Ext.kt, 8)
field = receiver$0: frameThis0Ext.AExt = {frameThis0Ext.AExt@uniqueID} (sp = null)
field = prop2: int = 1 (sp = frameThis0Ext.kt, 24)
field = prop2: int = 1 (sp = frameThis0Ext.kt, 25)
field = $val1: int = 1 (sp = null)
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
@@ -1,11 +1,12 @@
LineBreakpoint created at frameThis0This0.kt:16
LineBreakpoint created at frameThis0This0.kt:17
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!CUSTOM_LIBRARY!;!RT_JAR! frameThis0This0.FrameThis0This0Package
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
frameThis0This0.kt:16
frameThis0This0.kt:17
Compile bytecode for val1
Compile bytecode for val2
Compile bytecode for prop1
Compile bytecode for prop1 + val1 + val2
Compile bytecode for myFun()
package frameThis0This0
fun main(args: Array<String>) {
@@ -14,6 +15,7 @@ fun main(args: Array<String>) {
class A {
val prop1 = 1
fun myFun() = 1
fun test() {
val val1 = 1
@@ -44,7 +46,10 @@ fun foo(f: () -> Unit) {
// EXPRESSION: prop1 + val1 + val2
// RESULT: 3: I
frame = invoke():16, A$test$1$1 {frameThis0This0}
// EXPRESSION: myFun()
// RESULT: 1: I
frame = invoke():17, A$test$1$1 {frameThis0This0}
this = this = {frameThis0This0.A$test$1$1@uniqueID}kotlin.Function0<kotlin.Unit>
field = this$0: frameThis0This0.A$test$1 = {frameThis0This0.A$test$1@uniqueID}kotlin.Function0<kotlin.Unit> (sp = null)
field = this$0: frameThis0This0.A = {frameThis0This0.A@uniqueID} (sp = null)
@@ -7,6 +7,7 @@ fun main(args: Array<String>) {
class A {
class object {
val prop = 1
fun myFun() = 1
}
fun test() {
@@ -24,4 +25,7 @@ fun foo(f: () -> Unit) {
// PRINT_FRAME
// EXPRESSION: prop
// RESULT: 1: I
// EXPRESSION: myFun()
// RESULT: 1: I
@@ -6,10 +6,12 @@ fun main(args: Array<String>) {
class A {
val aProp = 1
fun aMyFun() = 1
}
class Outer {
val outerProp = 1
fun outerMyFun() = 1
fun A.foo() {
val valFoo = 1
@@ -37,6 +39,7 @@ class Outer {
class B {
val bProp = 1
fun bMyFun() = 1
}
fun lambda(f: () -> Unit) {
@@ -58,4 +61,13 @@ fun lambda(f: () -> Unit) {
// RESULT: 1: I
// EXPRESSION: bProp
// RESULT: 1: I
// EXPRESSION: aMyFun()
// RESULT: 1: I
// EXPRESSION: outerMyFun()
// RESULT: 1: I
// EXPRESSION: bMyFun()
// RESULT: 1: I
@@ -6,6 +6,7 @@ fun main(args: Array<String>) {
class A {
val prop = 1
fun myFun() = 1
}
fun A.foo() {
@@ -16,4 +17,7 @@ fun A.foo() {
// PRINT_FRAME
// EXPRESSION: prop
// RESULT: 1: I
// EXPRESSION: myFun()
// RESULT: 1: I
@@ -6,9 +6,11 @@ fun main(args: Array<String>) {
class A {
val prop1 = 1
fun myFun1() = 1
inner class Inner {
val prop2 = 1
fun myFun2() = 1
fun test() {
//Breakpoint!
@@ -23,4 +25,10 @@ class A {
// RESULT: 1: I
// EXPRESSION: prop2
// RESULT: 1: I
// EXPRESSION: myFun1()
// RESULT: 1: I
// EXPRESSION: myFun2()
// RESULT: 1: I
@@ -9,6 +9,7 @@ fun main(args: Array<String>) {
object O {
val obProp = 1
fun obMyFun() = 1
}
fun foo(f: () -> Unit) {
@@ -18,4 +19,7 @@ fun foo(f: () -> Unit) {
// PRINT_FRAME
// EXPRESSION: O.obProp
// RESULT: 1: I
// EXPRESSION: O.obMyFun()
// RESULT: 1: I
@@ -6,6 +6,7 @@ fun main(args: Array<String>) {
class A {
val prop1 = 1
fun myFun() = 1
fun test() {
val val1 = 1
@@ -33,4 +34,7 @@ fun foo(f: () -> Unit) {
// RESULT: 1: I
// EXPRESSION: prop1 + val1 + val2
// RESULT: 3: I
// RESULT: 3: I
// EXPRESSION: myFun()
// RESULT: 1: I
@@ -6,6 +6,7 @@ fun main(args: Array<String>) {
class A {
val prop1 = 1
fun myFun1() = 1
fun AExt.testExt() {
val val1 = 1
@@ -22,6 +23,7 @@ class A {
class AExt {
val prop2 = 1
fun myFun2() = 1
}
fun foo(f: () -> Unit) {
@@ -43,4 +45,10 @@ fun foo(f: () -> Unit) {
// RESULT: 2: I
// EXPRESSION: prop2 + val1
// RESULT: 2: I
// RESULT: 2: I
// EXPRESSION: myFun1()
// RESULT: 1: I
// EXPRESSION: myFun2()
// RESULT: 1: I
@@ -6,6 +6,7 @@ fun main(args: Array<String>) {
class A {
val prop1 = 1
fun myFun() = 1
fun test() {
val val1 = 1
@@ -35,4 +36,7 @@ fun foo(f: () -> Unit) {
// RESULT: 1: I
// EXPRESSION: prop1 + val1 + val2
// RESULT: 3: I
// RESULT: 3: I
// EXPRESSION: myFun()
// RESULT: 1: I