Debugger tests: do not print line numbers in stdlib

This commit is contained in:
Natalia Ukhorskaya
2014-09-12 15:33:14 +04:00
parent 3eeed559b4
commit e16673f50a
14 changed files with 45 additions and 86 deletions
@@ -0,0 +1,5 @@
package customLib.simpleLibFile
public fun foo() {
val a = 1
}
@@ -2,6 +2,7 @@ LineBreakpoint created at 1.kt:3
LineBreakpoint created at 1.kt:3
LineBreakpoint created at 1.kt:3
LineBreakpoint created at 1.kt:3
LineBreakpoint created at simpleLibFile.kt:3
!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! customLibClassName.CustomLibClassNamePackage
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
1.kt:3
@@ -12,6 +13,8 @@ Compile bytecode for 1 + 2
Compile bytecode for 1 + 3
1.kt:3
Compile bytecode for 1 + 4
simpleLibFile.kt:3
Compile bytecode for 1 + 5
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
Process finished with exit code 0
@@ -1,8 +0,0 @@
LineBreakpoint created at Delegation.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 !APP_PATH!\classes;!KOTLIN_RUNTIME!;!CUSTOM_LIBRARY!;!RT_JAR! stdlibDelegatedProperty.StdlibDelegatedPropertyPackage
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
Delegation.kt:48
Compile bytecode for value.toString()
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
Process finished with exit code 0
@@ -1,8 +0,0 @@
LineBreakpoint created at Ranges.kt:7
!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! stdlibRange.StdlibRangePackage
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
Ranges.kt:7
Compile bytecode for start <= item
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
Process finished with exit code 0
@@ -1,8 +0,0 @@
LineBreakpoint created at StringsJVM.kt:163
!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! stdlibSlice.StdlibSlicePackage
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
StringsJVM.kt:163
Compile bytecode for range.start
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
Process finished with exit code 0
@@ -4,7 +4,7 @@ Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socke
stepIntoSpecificKotlinClasses.kt:7
MyJavaClass.java:11
stepIntoSpecificKotlinClasses.kt:7
Intrinsics.class:17
Intrinsics.class
stepIntoSpecificKotlinClasses.kt:7
stepIntoSpecificKotlinClasses.kt:8
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
@@ -2,7 +2,8 @@ LineBreakpoint created at stepIntoStdlib.kt:6
!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! stepIntoStdlib.StepIntoStdlibPackage
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
stepIntoStdlib.kt:5
KotlinPackage.class:-1
KotlinPackage.class
_Mapping.kt
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
Process finished with exit code 0
@@ -5,6 +5,7 @@ fun main(args: Array<String>) {
customLib.twoFunDifferentSignature.twoFunDifferentSignatureFun()
customLib.property.foo
customLib.breakpointOnLocalProperty.breakpointOnLocalPropertyFun()
customLib.simpleLibFile.foo()
}
// ADDITIONAL_BREAKPOINT: 1.kt:public fun oneFunSameFileNameFun(): Int {
@@ -21,4 +22,8 @@ fun main(args: Array<String>) {
// ADDITIONAL_BREAKPOINT: 1.kt:public fun breakpointOnLocalPropertyFun(): Int {
// EXPRESSION: 1 + 4
// RESULT: 5: I
// RESULT: 5: I
// ADDITIONAL_BREAKPOINT: simpleLibFile.kt:public fun foo() {
// EXPRESSION: 1 + 5
// RESULT: 6: I
@@ -1,15 +0,0 @@
package stdlibDelegatedProperty
import kotlin.properties.Delegates
var prop: Int by Delegates.notNull()
fun main(args: Array<String>) {
prop = 3
val a = prop
}
// ADDITIONAL_BREAKPOINT: Delegation.kt:public override fun set(thisRef: Any?, desc: PropertyMetadata, value: T) {
// EXPRESSION: value.toString()
// RESULT: "3": Ljava/lang/String;
@@ -1,14 +0,0 @@
package stdlibRange
fun main(args: Array<String>) {
A().rangeTo(A()).contains(A())
}
class A: Comparable<A> {
override fun compareTo(other: A) = 0
}
// ADDITIONAL_BREAKPOINT: Ranges.kt:override fun contains(item: T): Boolean {
// EXPRESSION: start <= item
// RESULT: 1: Z
@@ -1,11 +0,0 @@
package stdlibSlice
fun main(args: Array<String>) {
val c: CharSequence = "CharSequence"
c.slice(0..1)
}
// ADDITIONAL_BREAKPOINT: StringsJVM.kt:CharSequence.slice(range: IntRange): CharSequence
// EXPRESSION: range.start
// RESULT: 0: I
@@ -7,4 +7,5 @@ fun main(args: Array<String>) {
val b = 1
}
// REPEAT: 2
// TRACING_FILTERS_ENABLED: false
@@ -19,6 +19,11 @@ package org.jetbrains.jet.plugin.debugger
import com.intellij.debugger.engine.DebugProcessImpl
import com.intellij.debugger.engine.SuspendContextImpl
import com.intellij.debugger.engine.MethodFilter
import org.jetbrains.jet.plugin.refactoring.runReadAction
import com.intellij.debugger.impl.PositionUtil
import com.intellij.execution.process.ProcessOutputTypes
import com.intellij.openapi.roots.libraries.LibraryUtil
import org.jetbrains.jet.plugin.JetJdkAndLibraryProjectDescriptor
abstract class KotlinDebuggerTestBase : KotlinDebuggerTestCase() {
@@ -41,7 +46,28 @@ abstract class KotlinDebuggerTestBase : KotlinDebuggerTestCase() {
}
protected fun SuspendContextImpl.printContext() {
printContext(this)
runReadAction { (): Unit ->
if (this.getFrameProxy() == null) {
return@runReadAction println("Context thread is null", ProcessOutputTypes.SYSTEM)
}
val sourcePosition = PositionUtil.getSourcePosition(this)
if (sourcePosition == null) {
return@runReadAction println("SourcePosition is null", ProcessOutputTypes.SYSTEM)
}
val virtualFile = sourcePosition.getFile().getVirtualFile()
if (virtualFile == null) {
return@runReadAction println("VirtualFile for position is null", ProcessOutputTypes.SYSTEM)
}
val isInStdlib = LibraryUtil.findLibraryEntry(virtualFile, getProject())?.getPresentableName() == JetJdkAndLibraryProjectDescriptor.LIBRARY_NAME
if (isInStdlib) {
return@runReadAction println(virtualFile.getName(), ProcessOutputTypes.SYSTEM)
}
println(virtualFile.getName() + ":" + sourcePosition.getLine(), ProcessOutputTypes.SYSTEM)
}
}
protected fun finish() {
@@ -375,24 +375,6 @@ public class KotlinEvaluateExpressionTestGenerated extends AbstractKotlinEvaluat
doMultipleBreakpointsTest(fileName);
}
@TestMetadata("stdlibDelegatedProperty.kt")
public void testStdlibDelegatedProperty() throws Exception {
String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/library/stdlibDelegatedProperty.kt");
doMultipleBreakpointsTest(fileName);
}
@TestMetadata("stdlibRange.kt")
public void testStdlibRange() throws Exception {
String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/library/stdlibRange.kt");
doMultipleBreakpointsTest(fileName);
}
@TestMetadata("stdlibSlice.kt")
public void testStdlibSlice() throws Exception {
String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/library/stdlibSlice.kt");
doMultipleBreakpointsTest(fileName);
}
}
}