Debugger: Replace unsafe location() calls with safeLocation()

This commit is contained in:
Yan Zhulanow
2020-05-01 22:33:40 +09:00
parent e6791ea4c3
commit d0f34624bd
2 changed files with 3 additions and 2 deletions
@@ -22,7 +22,7 @@ class KotlinExtraSteppingFilter : ExtraSteppingFilter {
val debugProcess = context.debugProcess ?: return false
val positionManager = KotlinPositionManager(debugProcess)
val location = context.frameProxy?.location() ?: return false
val location = context.frameProxy?.safeLocation() ?: return false
return runReadAction {
shouldFilter(positionManager, location)
}
@@ -26,6 +26,7 @@ import com.intellij.openapi.diagnostic.Logger
import com.sun.jdi.VMDisconnectedException
import com.sun.jdi.request.StepRequest
import org.intellij.lang.annotations.MagicConstant
import org.jetbrains.kotlin.idea.debugger.safeLocation
import java.lang.reflect.Field
internal class RequestHintWithMethodFilter(
@@ -63,7 +64,7 @@ internal class RequestHintWithMethodFilter(
if (filter != null && frameProxy != null && filter !is BreakpointStepMethodFilter) {
/*NODE: Debugger API. Base implementation works only for smart step into, and calls filter only if !isTheSameFrame(context). */
if (filter.locationMatches(context.debugProcess, frameProxy.location())) {
if (filter.locationMatches(context.debugProcess, frameProxy.safeLocation())) {
targetMethodMatched = true
return filter.onReached(context, this)
}