diff --git a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/frame/CallFrameView.kt b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/frame/CallFrameView.kt index c0e58df492d8..925ed7213322 100644 --- a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/frame/CallFrameView.kt +++ b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/frame/CallFrameView.kt @@ -27,8 +27,11 @@ import org.jetbrains.debugger.* class CallFrameView @JvmOverloads constructor(val callFrame: CallFrame, private val viewSupport: DebuggerViewSupport, val script: Script? = null, - private val sourceInfo: SourceInfo? = viewSupport.getSourceInfo(script, callFrame), - private val isInLibraryContent: Boolean = sourceInfo != null && viewSupport.isInLibraryContent(sourceInfo, script)) : XStackFrame(), VariableContext { + sourceInfo: SourceInfo? = null, + isInLibraryContent: Boolean? = null) : XStackFrame(), VariableContext { + private val sourceInfo = sourceInfo ?: viewSupport.getSourceInfo(script, callFrame) + private val isInLibraryContent: Boolean = isInLibraryContent ?: (this.sourceInfo != null && viewSupport.isInLibraryContent(this.sourceInfo, script)) + private var evaluator: XDebuggerEvaluator? = null override fun getEqualityObject() = callFrame.equalityObject diff --git a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/frame/ExecutionStackImpl.kt b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/frame/ExecutionStackImpl.kt index 8ace72b04e68..d4995ca28362 100644 --- a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/frame/ExecutionStackImpl.kt +++ b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/frame/ExecutionStackImpl.kt @@ -18,19 +18,16 @@ package org.jetbrains.debugger.frame import com.intellij.xdebugger.frame.XExecutionStack import com.intellij.xdebugger.frame.XStackFrame import com.intellij.xdebugger.settings.XDebuggerSettingsManager -import org.jetbrains.debugger.DebuggerViewSupport -import org.jetbrains.debugger.Script -import org.jetbrains.debugger.SuspendContext -import org.jetbrains.debugger.done +import org.jetbrains.debugger.* import java.util.* -internal class ExecutionStackImpl(private val suspendContext: SuspendContext, private val viewSupport: DebuggerViewSupport, private val topFrameScript: Script?) : XExecutionStack("") { +internal class ExecutionStackImpl(private val suspendContext: SuspendContext, private val viewSupport: DebuggerViewSupport, private val topFrameScript: Script?, private val topFrameSourceInfo: SourceInfo? = null) : XExecutionStack("") { private var topCallFrameView: CallFrameView? = null override fun getTopFrame(): CallFrameView? { val topCallFrame = suspendContext.topFrame if (topCallFrameView == null || topCallFrameView!!.callFrame != topCallFrame) { - topCallFrameView = if (topCallFrame == null) null else CallFrameView(topCallFrame, viewSupport, topFrameScript) + topCallFrameView = if (topCallFrame == null) null else CallFrameView(topCallFrame, viewSupport, topFrameScript, topFrameSourceInfo) } return topCallFrameView } diff --git a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/frame/SuspendContextImpl.kt b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/frame/SuspendContextImpl.kt index 29fa4b5724a8..10e81d451fc7 100644 --- a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/frame/SuspendContextImpl.kt +++ b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/frame/SuspendContextImpl.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2000-2015 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.jetbrains.debugger.frame import com.intellij.xdebugger.frame.XSuspendContext @@ -5,14 +20,11 @@ import org.jetbrains.concurrency.Promise import org.jetbrains.concurrency.rejectedPromise import org.jetbrains.concurrency.resolvedPromise import org.jetbrains.concurrency.thenAsync -import org.jetbrains.debugger.DebuggerViewSupport -import org.jetbrains.debugger.EvaluateContext -import org.jetbrains.debugger.Script -import org.jetbrains.debugger.SuspendContext +import org.jetbrains.debugger.* import org.jetbrains.debugger.values.StringValue -open class SuspendContextImpl(private val suspendContext: SuspendContext, debugProcess: DebuggerViewSupport, topFrameScript: Script?) : XSuspendContext() { - private val executionStack = ExecutionStackImpl(suspendContext, debugProcess, topFrameScript) +open class SuspendContextImpl(suspendContext: SuspendContext, debugProcess: DebuggerViewSupport, topFrameScript: Script?, topFrameSourceInfo: SourceInfo? = null) : XSuspendContext() { + private val executionStack = ExecutionStackImpl(suspendContext, debugProcess, topFrameScript, topFrameSourceInfo) override fun getActiveExecutionStack() = executionStack