Debugger: do not put breakpoints at lines from another file in case of inline function
This commit is contained in:
@@ -299,7 +299,7 @@ class KotlinPositionManager(private val myDebugProcess: DebugProcess) : MultiReq
|
|||||||
try {
|
try {
|
||||||
val line = position.line + 1
|
val line = position.line + 1
|
||||||
val locations = if (myDebugProcess.virtualMachineProxy.versionHigher("1.4"))
|
val locations = if (myDebugProcess.virtualMachineProxy.versionHigher("1.4"))
|
||||||
type.locationsOfLine("Kotlin", null, line)
|
type.locationsOfLine("Kotlin", null, line).filter { it.sourceName("Kotlin") == position.file.name }
|
||||||
else
|
else
|
||||||
type.locationsOfLine(line)
|
type.locationsOfLine(line)
|
||||||
if (locations == null || locations.isEmpty()) throw NoDataException.INSTANCE
|
if (locations == null || locations.isEmpty()) throw NoDataException.INSTANCE
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
LineBreakpoint created at inlineFunctionWithBreakpoint.kt:4
|
||||||
|
!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! inlineFunctionBreakpointAnotherFile.InlineFunctionBreakpointAnotherFileKt
|
||||||
|
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
|
inlineFunctionWithBreakpoint.kt:4
|
||||||
|
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
|
|
||||||
|
Process finished with exit code 0
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
LineBreakpoint created at functionInLibrary.kt:4
|
LineBreakpoint created at functionInLibrary.kt:4
|
||||||
!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! stepIntoStdlibInlineFun2step.StepIntoStdlibInlineFun2stepKt
|
!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! stepIntoStdlibInlineFun2step.StepIntoStdlibInlineFun2stepKt
|
||||||
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
stepIntoStdlibInlineFun2step.kt:4
|
|
||||||
functionInLibrary.kt:4
|
functionInLibrary.kt:4
|
||||||
functionInLibrary.kt:8
|
functionInLibrary.kt:8
|
||||||
|
stepIntoStdlibInlineFun2step.kt:5
|
||||||
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
|
|
||||||
Process finished with exit code 0
|
Process finished with exit code 0
|
||||||
|
|||||||
Vendored
+13
@@ -0,0 +1,13 @@
|
|||||||
|
package inlineFunctionBreakpointAnotherFile
|
||||||
|
|
||||||
|
fun main(args: Array<String>) {
|
||||||
|
val a1 = 1
|
||||||
|
val a2 = 1
|
||||||
|
val a3 = 1
|
||||||
|
|
||||||
|
inlineFunctionWithBreakpoint.myFun {
|
||||||
|
val a = 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ADDITIONAL_BREAKPOINT: inlineFunctionWithBreakpoint.kt:inline fun myFun
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package inlineFunctionWithBreakpoint
|
||||||
|
|
||||||
|
inline fun myFun(f: (Int) -> Unit) {
|
||||||
|
f(1)
|
||||||
|
}
|
||||||
+6
@@ -169,6 +169,12 @@ public class KotlinEvaluateExpressionTestGenerated extends AbstractKotlinEvaluat
|
|||||||
doSingleBreakpointTest(fileName);
|
doSingleBreakpointTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("inlineFunctionBreakpointAnotherFile.kt")
|
||||||
|
public void testInlineFunctionBreakpointAnotherFile() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/inlineFunctionBreakpointAnotherFile.kt");
|
||||||
|
doSingleBreakpointTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("inlineFunctionBreakpointVariants.kt")
|
@TestMetadata("inlineFunctionBreakpointVariants.kt")
|
||||||
public void testInlineFunctionBreakpointVariants() throws Exception {
|
public void testInlineFunctionBreakpointVariants() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/inlineFunctionBreakpointVariants.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/inlineFunctionBreakpointVariants.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user