mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-04 23:39:07 +07:00
[debugger] Fix a couple of cases with invalid statistics reporting
IDEA-362361 (cherry picked from commit 7bdf1ca436e487c70eff2badde6f9531e3960e4b) IJ-CR-151042 GitOrigin-RevId: 098cf93fb08e99d71ab75ad7e19cfd336533d6b9
This commit is contained in:
committed by
intellij-monorepo-bot
parent
4c5fca5bc6
commit
a635619cd2
@@ -19,7 +19,7 @@ object KotlinDebuggerEvaluatorStatisticsCollector : CounterUsagesCollector() {
|
||||
|
||||
override fun getGroup(): EventLogGroup = GROUP
|
||||
|
||||
private val GROUP = EventLogGroup("kotlin.debugger.evaluator", 9)
|
||||
private val GROUP = EventLogGroup("kotlin.debugger.evaluator", 10)
|
||||
|
||||
// fields
|
||||
private val compilerField = EventFields.Enum<CompilerType>("compiler")
|
||||
@@ -77,6 +77,7 @@ enum class StatisticsEvaluationResult {
|
||||
COMPILER_INTERNAL_ERROR,
|
||||
UNCLASSIFIED_COMPILATION_PROBLEM,
|
||||
|
||||
UNSUPPORTED_CALL, // Check KotlinEvaluator.calculateMainMethodCallArguments for examples
|
||||
UNCLASSIFIED_EVALUATION_PROBLEM,
|
||||
MISCOMPILED,
|
||||
ERROR_DURING_PARSING_EXCEPTION,
|
||||
|
||||
@@ -165,6 +165,7 @@ class KotlinEvaluator(val codeFragment: KtCodeFragment, private val sourcePositi
|
||||
if (!hasCast && e.cause is ClassCastException) StatisticsEvaluationResult.MISCOMPILED
|
||||
else StatisticsEvaluationResult.USER_EXCEPTION
|
||||
e is EvaluateException && cause != null -> checkCauseOfEvaluateException(cause, hasCast)
|
||||
e is EvaluateException -> StatisticsEvaluationResult.UNSUPPORTED_CALL
|
||||
isSpecialException(e) -> StatisticsEvaluationResult.WRONG_JVM_STATE
|
||||
else -> StatisticsEvaluationResult.UNCLASSIFIED_EVALUATION_PROBLEM
|
||||
}
|
||||
@@ -184,7 +185,7 @@ class KotlinEvaluator(val codeFragment: KtCodeFragment, private val sourcePositi
|
||||
if (isApplicationInternalMode()) {
|
||||
reportErrorWithAttachments(context, codeFragment, e,
|
||||
prepareBytecodes(compiledData),
|
||||
"Can't perform evaluation. Compiled by ${compiledData.compilerType} compiler")
|
||||
"Can't perform evaluation: $errorType. Compiled by ${compiledData.compilerType} compiler")
|
||||
}
|
||||
}
|
||||
throw e
|
||||
@@ -196,6 +197,11 @@ class KotlinEvaluator(val codeFragment: KtCodeFragment, private val sourcePositi
|
||||
try {
|
||||
val exceptionFromCodeFragment = cause.exception()
|
||||
val type = exceptionFromCodeFragment.type()
|
||||
if (type.signature().equals("Ljava/lang/IllegalArgumentException;")) {
|
||||
if (DebuggerUtils.tryExtractExceptionMessage(exceptionFromCodeFragment) == "argument type mismatch") {
|
||||
return StatisticsEvaluationResult.MISCOMPILED
|
||||
}
|
||||
}
|
||||
if (type.signature().startsWith("Ljava/lang/invoke/") || type.isSubTypeOrSame("java.lang.ReflectiveOperationException")) {
|
||||
return StatisticsEvaluationResult.MISCOMPILED
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user