Debugger: Gracefully handle debugger exceptions we can't do anything reasonable with (EA-128154, EA-139473)

This commit is contained in:
Yan Zhulanow
2019-07-24 17:48:58 +09:00
parent 70745f233f
commit 17c3406097
4 changed files with 44 additions and 26 deletions
@@ -40,6 +40,7 @@ import org.jetbrains.kotlin.idea.KotlinFileType
import org.jetbrains.kotlin.idea.core.util.getKotlinJvmRuntimeMarkerClass
import org.jetbrains.kotlin.idea.debugger.evaluate.compilation.DebugLabelPropertyDescriptorProvider
import org.jetbrains.kotlin.idea.debugger.getContextElement
import org.jetbrains.kotlin.idea.debugger.hopelessAware
import org.jetbrains.kotlin.idea.j2k.J2kPostProcessor
import org.jetbrains.kotlin.idea.j2k.convertToKotlin
import org.jetbrains.kotlin.idea.j2k.j2kText
@@ -175,10 +176,12 @@ class KotlinCodeFragmentFactory : CodeFragmentFactory() {
val worker = object : DebuggerCommandImpl() {
override fun action() {
try {
val frame = if (ApplicationManager.getApplication().isUnitTestMode) {
contextElement?.getCopyableUserData(DEBUG_CONTEXT_FOR_TESTS)?.frameProxy?.stackFrame
} else {
debuggerContext.frameProxy?.stackFrame
val frame = hopelessAware {
if (ApplicationManager.getApplication().isUnitTestMode) {
contextElement?.getCopyableUserData(DEBUG_CONTEXT_FOR_TESTS)?.frameProxy?.stackFrame
} else {
debuggerContext.frameProxy?.stackFrame
}
}
frameInfo = FrameInfo.from(debuggerContext.project, frame)