Debugger: Minor, check evaluator preconditions as in Java evaluator
This commit is contained in:
+6
-1
@@ -128,9 +128,14 @@ class KotlinEvaluator(val codeFragment: KtCodeFragment, val sourcePosition: Sour
|
||||
}
|
||||
}
|
||||
|
||||
if (!context.debugProcess.isAttached) {
|
||||
status.error(EvaluationError.DebuggerNotAttached)
|
||||
throw EvaluateExceptionUtil.PROCESS_EXITED
|
||||
}
|
||||
|
||||
val frameProxy = context.frameProxy ?: run {
|
||||
status.error(EvaluationError.NoFrameProxy)
|
||||
evaluationException("Cannot evaluate a code fragment: frame proxy is not available")
|
||||
throw EvaluateExceptionUtil.NULL_STACK_FRAME
|
||||
}
|
||||
|
||||
val operatingThread = context.suspendContext.thread ?: run {
|
||||
|
||||
+1
@@ -51,6 +51,7 @@ class EvaluationStatus {
|
||||
}
|
||||
|
||||
enum class EvaluationError {
|
||||
DebuggerNotAttached,
|
||||
NoFrameProxy,
|
||||
ThreadNotAvailable,
|
||||
ThreadNotSuspended,
|
||||
|
||||
Reference in New Issue
Block a user