Debugger: Implement error reporting for evaluator

This commit is contained in:
Yan Zhulanow
2019-05-27 18:36:42 +09:00
parent 8a5fd44a55
commit 7e564e94ed
6 changed files with 282 additions and 48 deletions
@@ -16,6 +16,7 @@
package org.jetbrains.kotlin.idea.debugger
import com.intellij.debugger.engine.DebugProcessImpl
import com.intellij.debugger.DebuggerContext
import com.intellij.debugger.engine.JavaStackFrame
import com.intellij.debugger.engine.JavaValue
@@ -50,6 +51,7 @@ import org.jetbrains.kotlin.codegen.inline.INLINE_FUN_VAR_SUFFIX
import org.jetbrains.kotlin.codegen.inline.isFakeLocalVariableForInline
import org.jetbrains.org.objectweb.asm.Type as AsmType
import org.jetbrains.kotlin.utils.getSafe
import org.jetbrains.kotlin.idea.debugger.evaluate.KotlinDebuggerEvaluator
import java.lang.reflect.Modifier
import java.util.*
@@ -60,6 +62,13 @@ class KotlinStackFrame(frame: StackFrameProxyImpl) : JavaStackFrame(StackFrameDe
private val kotlinVariableViewService = ToggleKotlinVariablesState.getService()
private val kotlinEvaluator by lazy {
val debugProcess = descriptor.debugProcess as DebugProcessImpl // Cast as in JavaStackFrame
KotlinDebuggerEvaluator(debugProcess, this@KotlinStackFrame)
}
override fun getEvaluator() = kotlinEvaluator
override fun superBuildVariables(evaluationContext: EvaluationContextImpl, children: XValueChildrenList) {
if (!kotlinVariableViewService.kotlinVariableView) {
return super.superBuildVariables(evaluationContext, children)