From eb8415a1f322b38c10fff629805df61a21b44b95 Mon Sep 17 00:00:00 2001 From: Nikolay Krasko Date: Mon, 21 Nov 2016 18:22:11 +0300 Subject: [PATCH] Use new api from idea 171 in KotlinStepOverInlinedLinesHint --- .../KotlinStepOverInlinedLinesHint.kt | 62 +------------------ 1 file changed, 1 insertion(+), 61 deletions(-) diff --git a/idea/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinStepOverInlinedLinesHint.kt b/idea/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinStepOverInlinedLinesHint.kt index 3693d28edf8..2edcaf6014d 100644 --- a/idea/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinStepOverInlinedLinesHint.kt +++ b/idea/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinStepOverInlinedLinesHint.kt @@ -35,70 +35,10 @@ class KotlinStepOverInlinedLinesHint( private val LOG = Logger.getInstance(KotlinStepOverInlinedLinesHint::class.java) - private var mySteppedOut = false - - private var myFrameCount: Int - private var myPosition: SourcePosition? - - // TODO: Copied from RequestHint constructor. But can't reused code because of private fields. - init { - var frameCount = 0 - var position: SourcePosition? = null - try { - frameCount = stepThread.frameCount() - - position = ApplicationManager.getApplication().runReadAction(Computable { - ContextUtil.getSourcePosition(object : StackFrameContext { - override fun getFrameProxy(): StackFrameProxy? { - try { - return stepThread.frame(0) - } - catch (e: EvaluateException) { - LOG.debug(e) - return null - } - - } - - override fun getDebugProcess(): DebugProcess { - return suspendContext.debugProcess - } - }) - }) - } - catch (e: Exception) { - LOG.info(e) - } - finally { - myFrameCount = frameCount - myPosition = position - } - } - private val filter = methodFilter override fun getDepth(): Int = StepRequest.STEP_OVER - // TODO: Copy of RequestHint.isTheSameFrame() - private fun isTheSameFrame(context: SuspendContextImpl): Boolean { - if (mySteppedOut) return false - - val contextThread = context.thread - if (contextThread != null) { - try { - val currentDepth = contextThread.frameCount() - if (currentDepth < myFrameCount) { - mySteppedOut = true - } - return currentDepth == myFrameCount - } - catch (ignored: EvaluateException) { - } - - } - return false - } - override fun getNextStepDepth(context: SuspendContextImpl): Int { try { val frameProxy = context.frameProxy @@ -112,7 +52,7 @@ class KotlinStepOverInlinedLinesHint( } } - if (mySteppedOut) { + if (isSteppedOut) { return STOP }