From c071bf5c639d593c1e49809569782ecaafb3ba14 Mon Sep 17 00:00:00 2001 From: Natalia Ukhorskaya Date: Tue, 27 Oct 2015 10:38:08 +0300 Subject: [PATCH] Fix lines for FieldBreakpoints in tests --- .../tinyApp/outs/fwAbstractProperty.out | 8 ++--- .../debugger/tinyApp/outs/fwBackingField.out | 16 +++++----- .../debugger/tinyApp/outs/fwInitializer.out | 6 ++-- .../tinyApp/outs/fwPropertyInInterface.out | 8 ++--- .../tinyApp/outs/withoutBodyProperties.out | 21 ++++--------- .../tinyApp/outs/withoutBodyProperties2.out | 11 +++++++ .../withoutBodyProperties.kt | 30 +++++-------------- .../withoutBodyProperties2.kt | 21 +++++++++++++ .../idea/debugger/KotlinDebuggerTestBase.kt | 3 +- 9 files changed, 66 insertions(+), 58 deletions(-) create mode 100644 idea/testData/debugger/tinyApp/outs/withoutBodyProperties2.out create mode 100644 idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/withoutBodyProperties2.kt diff --git a/idea/testData/debugger/tinyApp/outs/fwAbstractProperty.out b/idea/testData/debugger/tinyApp/outs/fwAbstractProperty.out index be80c8d95dc..baf0b9bc7fa 100644 --- a/idea/testData/debugger/tinyApp/outs/fwAbstractProperty.out +++ b/idea/testData/debugger/tinyApp/outs/fwAbstractProperty.out @@ -1,7 +1,7 @@ -KotlinFieldBreakpoint created at fwAbstractProperty.kt:5 -KotlinFieldBreakpoint created at fwAbstractProperty.kt:8 -KotlinFieldBreakpoint created at fwAbstractProperty.kt:42 -KotlinFieldBreakpoint created at fwAbstractProperty.kt:45 +KotlinFieldBreakpoint created at fwAbstractProperty.kt:6 +KotlinFieldBreakpoint created at fwAbstractProperty.kt:9 +KotlinFieldBreakpoint created at fwAbstractProperty.kt:43 +KotlinFieldBreakpoint created at fwAbstractProperty.kt:46 !JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !OUTPUT_PATH!;!KOTLIN_RUNTIME!;!CUSTOM_LIBRARY!;!RT_JAR! fwAbstractProperty.FwAbstractPropertyKt Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' fwAbstractProperty.kt:57 diff --git a/idea/testData/debugger/tinyApp/outs/fwBackingField.out b/idea/testData/debugger/tinyApp/outs/fwBackingField.out index d2fb29efdf4..f1963d31cb1 100644 --- a/idea/testData/debugger/tinyApp/outs/fwBackingField.out +++ b/idea/testData/debugger/tinyApp/outs/fwBackingField.out @@ -1,11 +1,11 @@ -KotlinFieldBreakpoint created at fwBackingField.kt:4 -KotlinFieldBreakpoint created at fwBackingField.kt:7 -KotlinFieldBreakpoint created at fwBackingField.kt:17 -KotlinFieldBreakpoint created at fwBackingField.kt:20 -KotlinFieldBreakpoint created at fwBackingField.kt:30 -KotlinFieldBreakpoint created at fwBackingField.kt:32 -KotlinFieldBreakpoint created at fwBackingField.kt:44 -KotlinFieldBreakpoint created at fwBackingField.kt:47 +KotlinFieldBreakpoint created at fwBackingField.kt:5 +KotlinFieldBreakpoint created at fwBackingField.kt:8 +KotlinFieldBreakpoint created at fwBackingField.kt:18 +KotlinFieldBreakpoint created at fwBackingField.kt:21 +KotlinFieldBreakpoint created at fwBackingField.kt:31 +KotlinFieldBreakpoint created at fwBackingField.kt:33 +KotlinFieldBreakpoint created at fwBackingField.kt:45 +KotlinFieldBreakpoint created at fwBackingField.kt:48 !JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !OUTPUT_PATH!;!KOTLIN_RUNTIME!;!CUSTOM_LIBRARY!;!RT_JAR! fwBackingField.FwBackingFieldKt Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' fwBackingField.kt:18 diff --git a/idea/testData/debugger/tinyApp/outs/fwInitializer.out b/idea/testData/debugger/tinyApp/outs/fwInitializer.out index 17d860058cb..9aabec76701 100644 --- a/idea/testData/debugger/tinyApp/outs/fwInitializer.out +++ b/idea/testData/debugger/tinyApp/outs/fwInitializer.out @@ -1,6 +1,6 @@ -KotlinFieldBreakpoint created at fwInitializer.kt:11 -KotlinFieldBreakpoint created at fwInitializer.kt:16 -KotlinFieldBreakpoint created at fwInitializer.kt:20 +KotlinFieldBreakpoint created at fwInitializer.kt:12 +KotlinFieldBreakpoint created at fwInitializer.kt:17 +KotlinFieldBreakpoint created at fwInitializer.kt:21 !JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !OUTPUT_PATH!;!KOTLIN_RUNTIME!;!CUSTOM_LIBRARY!;!RT_JAR! fwInitializer.FwInitializerKt Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' fwInitializer.kt:12 diff --git a/idea/testData/debugger/tinyApp/outs/fwPropertyInInterface.out b/idea/testData/debugger/tinyApp/outs/fwPropertyInInterface.out index 2a5d2613ee9..a51c8a6a354 100644 --- a/idea/testData/debugger/tinyApp/outs/fwPropertyInInterface.out +++ b/idea/testData/debugger/tinyApp/outs/fwPropertyInInterface.out @@ -1,7 +1,7 @@ -KotlinFieldBreakpoint created at fwPropertyInInterface.kt:5 -KotlinFieldBreakpoint created at fwPropertyInInterface.kt:8 -KotlinFieldBreakpoint created at fwPropertyInInterface.kt:42 -KotlinFieldBreakpoint created at fwPropertyInInterface.kt:45 +KotlinFieldBreakpoint created at fwPropertyInInterface.kt:6 +KotlinFieldBreakpoint created at fwPropertyInInterface.kt:9 +KotlinFieldBreakpoint created at fwPropertyInInterface.kt:43 +KotlinFieldBreakpoint created at fwPropertyInInterface.kt:46 !JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !OUTPUT_PATH!;!KOTLIN_RUNTIME!;!CUSTOM_LIBRARY!;!RT_JAR! fwPropertyInInterface.FwPropertyInInterfaceKt Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' fwPropertyInInterface.kt:57 diff --git a/idea/testData/debugger/tinyApp/outs/withoutBodyProperties.out b/idea/testData/debugger/tinyApp/outs/withoutBodyProperties.out index 3760f68e0b5..8df33fbd473 100644 --- a/idea/testData/debugger/tinyApp/outs/withoutBodyProperties.out +++ b/idea/testData/debugger/tinyApp/outs/withoutBodyProperties.out @@ -1,25 +1,16 @@ -LineBreakpoint created at withoutBodyProperties.kt:8 -LineBreakpoint created at withoutBodyProperties.kt:13 -LineBreakpoint created at withoutBodyProperties.kt:18 -LineBreakpoint created at withoutBodyProperties.kt:23 -LineBreakpoint created at withoutBodyProperties.kt:28 -LineBreakpoint created at withoutBodyProperties.kt:36 -LineBreakpoint created at withoutBodyProperties.kt:43 +KotlinFieldBreakpoint created at withoutBodyProperties.kt:8 +KotlinFieldBreakpoint created at withoutBodyProperties.kt:13 +LineBreakpoint created at withoutBodyProperties.kt:21 +KotlinFieldBreakpoint created at withoutBodyProperties.kt:28 !JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !OUTPUT_PATH!;!KOTLIN_RUNTIME!;!CUSTOM_LIBRARY!;!RT_JAR! withoutBodyProperties.WithoutBodyPropertiesKt Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' withoutBodyProperties.kt:8 Compile bytecode for 1 + 1 withoutBodyProperties.kt:13 -Compile bytecode for 1 + 2 -withoutBodyProperties.kt:18 Compile bytecode for 1 + 3 -withoutBodyProperties.kt:23 -Compile bytecode for 1 + 4 -withoutBodyProperties.kt:28 -Compile bytecode for 1 + 5 -withoutBodyProperties.kt:36 +withoutBodyProperties.kt:21 Compile bytecode for i -withoutBodyProperties.kt:43 +withoutBodyProperties.kt:28 Compile bytecode for 1 + 6 Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' diff --git a/idea/testData/debugger/tinyApp/outs/withoutBodyProperties2.out b/idea/testData/debugger/tinyApp/outs/withoutBodyProperties2.out new file mode 100644 index 00000000000..85ba1f2821f --- /dev/null +++ b/idea/testData/debugger/tinyApp/outs/withoutBodyProperties2.out @@ -0,0 +1,11 @@ +KotlinFieldBreakpoint created at withoutBodyProperties2.kt:8 +KotlinFieldBreakpoint created at withoutBodyProperties2.kt:13 +!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !OUTPUT_PATH!;!KOTLIN_RUNTIME!;!CUSTOM_LIBRARY!;!RT_JAR! withoutBodyProperties2.WithoutBodyProperties2Kt +Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' +withoutBodyProperties2.kt:8 +Compile bytecode for 1 + 4 +withoutBodyProperties2.kt:13 +Compile bytecode for 1 + 5 +Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' + +Process finished with exit code 0 diff --git a/idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/withoutBodyProperties.kt b/idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/withoutBodyProperties.kt index 60de03c92fc..c0f08f476c7 100644 --- a/idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/withoutBodyProperties.kt +++ b/idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/withoutBodyProperties.kt @@ -4,29 +4,14 @@ import kotlin.properties.Delegates // EXPRESSION: 1 + 1 // RESULT: 2: I -//Breakpoint! +//FieldWatchpoint! (a) val a = 1 -// EXPRESSION: 1 + 2 -// RESULT: 3: I -//Breakpoint! -var aDelegate: Int by Delegates.notNull() - // EXPRESSION: 1 + 3 // RESULT: 4: I -//Breakpoint! +//FieldWatchpoint! (aLambda) val aLambda = { 1 + 1 } -// EXPRESSION: 1 + 4 -// RESULT: 5: I -//Breakpoint! -val aWoBody: Int get() = 1 - -// EXPRESSION: 1 + 5 -// RESULT: 6: I -//Breakpoint! -val aWoBody2: Int get() { return 1 } - class A { init { // EXPRESSION: i @@ -39,7 +24,7 @@ class A { // EXPRESSION: 1 + 6 // RESULT: 7: I - //Breakpoint! + //FieldWatchpoint! (prop) val prop = 1 fun test()= prop @@ -47,10 +32,11 @@ class A { fun main(args: Array) { a - aDelegate = 1 aLambda - aWoBody - aWoBody2 A().test() -} \ No newline at end of file +} + +// WATCH_FIELD_INITIALISATION: true +// WATCH_FIELD_ACCESS: false +// WATCH_FIELD_MODIFICATION: false \ No newline at end of file diff --git a/idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/withoutBodyProperties2.kt b/idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/withoutBodyProperties2.kt new file mode 100644 index 00000000000..0b7e73fe266 --- /dev/null +++ b/idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/withoutBodyProperties2.kt @@ -0,0 +1,21 @@ +package withoutBodyProperties2 + +import kotlin.properties.Delegates + +// EXPRESSION: 1 + 4 +// RESULT: 5: I +//FieldWatchpoint! (aWoBody) +val aWoBody: Int get() = 1 + +// EXPRESSION: 1 + 5 +// RESULT: 6: I +//FieldWatchpoint! (aWoBody2) +val aWoBody2: Int get() { return 1 } + +fun main(args: Array) { + aWoBody + aWoBody2 +} + +// WATCH_FIELD_ACCESS: true +// WATCH_FIELD_MODIFICATION: false \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinDebuggerTestBase.kt b/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinDebuggerTestBase.kt index 80c611b2efc..743132e0098 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinDebuggerTestBase.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinDebuggerTestBase.kt @@ -42,7 +42,6 @@ import com.intellij.xdebugger.breakpoints.XBreakpoint import com.intellij.xdebugger.breakpoints.XBreakpointProperties import com.intellij.xdebugger.breakpoints.XBreakpointType import com.intellij.xdebugger.breakpoints.XLineBreakpointType -import com.sun.jdi.request.StepRequest import org.jetbrains.kotlin.idea.core.refactoring.getLineNumber import org.jetbrains.kotlin.idea.debugger.breakpoints.KotlinFieldBreakpoint import org.jetbrains.kotlin.idea.debugger.breakpoints.KotlinFieldBreakpointType @@ -304,7 +303,7 @@ abstract class KotlinDebuggerTestBase : KotlinDebuggerTestCase() { javaBreakpoint.setWatchModification(fileText.getValueForSetting("WATCH_FIELD_MODIFICATION", true)) javaBreakpoint.setWatchInitialization(fileText.getValueForSetting("WATCH_FIELD_INITIALISATION", false)) BreakpointManager.addBreakpoint(javaBreakpoint) - println("KotlinFieldBreakpoint created at ${file.getVirtualFile().getName()}:$lineIndex", ProcessOutputTypes.SYSTEM) + println("KotlinFieldBreakpoint created at ${file.getVirtualFile().getName()}:${lineIndex + 1}", ProcessOutputTypes.SYSTEM) } } }