EA-820036 - VMDE: TargetVM.waitForReply

GitOrigin-RevId: ffb2c6563e28477b930aa13564000f71641fe4ca
This commit is contained in:
Egor Ushakov
2024-03-01 11:11:38 +01:00
committed by intellij-monorepo-bot
parent 3ebdbc53c7
commit fc1b5ba67d
3 changed files with 14 additions and 14 deletions

View File

@@ -503,10 +503,10 @@ public final class DebuggerUtilsAsync {
return throwable instanceof CompletionException || throwable instanceof ExecutionException ? throwable.getCause() : throwable;
}
public static <T> T logError(@Nullable Throwable throwable) {
public static <T> T logError(@NotNull Throwable throwable) {
Throwable e = unwrap(throwable);
if (!(e instanceof CancellationException)) {
DebuggerUtilsImpl.logError(e, true); // wrap to keep the exact catch position
DebuggerUtilsImpl.logError(e.getMessage(), e, true); // wrap to keep the exact catch position
}
return null;
}

View File

@@ -228,15 +228,19 @@ public final class DebuggerUtilsImpl extends DebuggerUtilsEx {
return Boolean.TRUE.equals(debugProcess.getUserData(BatchEvaluator.REMOTE_SESSION_KEY));
}
public static void logError(Throwable e) {
logError(e, false);
public static void logError(@NotNull Throwable e) {
logError(e.getMessage(), e, false);
}
static void logError(Throwable e, boolean wrapIntoThrowable) {
public static void logError(String message, Throwable e) {
logError(message, e, false);
}
static void logError(String message, Throwable e, boolean wrapIntoThrowable) {
if (e instanceof VMDisconnectedException || e instanceof ProcessCanceledException) {
throw (RuntimeException)e;
}
LOG.error(wrapIntoThrowable ? new Throwable(e) : e);
LOG.error(message, wrapIntoThrowable ? new Throwable(e) : e);
}
public static <T, E extends Exception> T suppressExceptions(ThrowableComputable<? extends T, ? extends E> supplier,

View File

@@ -1,13 +1,13 @@
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.jetbrains.kotlin.idea.debugger.coroutine.proxy
import com.intellij.debugger.engine.DebuggerManagerThreadImpl
import com.intellij.debugger.engine.SuspendContextImpl
import com.intellij.debugger.impl.DebuggerUtilsImpl.logError
import org.jetbrains.kotlin.idea.debugger.base.util.evaluate.DefaultExecutionContext
import org.jetbrains.kotlin.idea.debugger.coroutine.data.CoroutineInfoCache
import org.jetbrains.kotlin.idea.debugger.coroutine.proxy.mirror.DebugProbesImpl
import org.jetbrains.kotlin.idea.debugger.coroutine.util.executionContext
import org.jetbrains.kotlin.idea.debugger.coroutine.util.logger
import org.jetbrains.kotlin.idea.debugger.base.util.evaluate.DefaultExecutionContext
class CoroutineDebugProbesProxy(val suspendContext: SuspendContextImpl) {
/**
@@ -24,7 +24,7 @@ class CoroutineDebugProbesProxy(val suspendContext: SuspendContextImpl) {
val infoList = libraryAgentProxy.dumpCoroutinesInfo()
coroutineInfoCache.ok(infoList)
} catch (e: Throwable) {
log.error("Exception is thrown by calling dumpCoroutines.", e)
logError("Exception is thrown by calling dumpCoroutines.", e)
coroutineInfoCache.fail()
}
return coroutineInfoCache
@@ -37,8 +37,4 @@ class CoroutineDebugProbesProxy(val suspendContext: SuspendContextImpl) {
CoroutineLibraryAgent2Proxy(executionContext, debugProbesImpl)
} else null
}
companion object {
private val log by logger
}
}