[debugger] always provide arguments to the method

GitOrigin-RevId: ccf92444c905ceacb1ae656ae417ce18833a149c
This commit is contained in:
Egor Ushakov
2025-01-09 14:11:42 +01:00
committed by intellij-monorepo-bot
parent ad8196d11c
commit 486a1434a9
2 changed files with 6 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.debugger.impl;
import com.intellij.configurationStore.XmlSerializer;
@@ -479,12 +479,13 @@ public final class DebuggerUtilsImpl extends DebuggerUtilsEx {
public static @Nullable Value invokeClassMethod(@NotNull EvaluationContext evaluationContext,
@NotNull ClassType type,
@NotNull String methodName,
@Nullable String signature) throws EvaluateException {
@Nullable String signature,
@NotNull List<Value> arguments) throws EvaluateException {
Method method = findMethod(type, methodName, signature);
if (method == null) {
throw new MethodNotFoundException("Method " + methodName + ", signature " + signature + " not found in class " + type.name());
}
return evaluationContext.getDebugProcess().invokeMethod(evaluationContext, type, method, Collections.emptyList());
return evaluationContext.getDebugProcess().invokeMethod(evaluationContext, type, method, arguments);
}
public static @Nullable Value invokeObjectMethod(@NotNull EvaluationContextImpl evaluationContext,

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.jetbrains.idea.devkit.debugger
import com.intellij.debugger.engine.DebugProcessImpl
@@ -45,7 +45,7 @@ internal fun getIdeState(evaluationContext: EvaluationContext): IdeState? {
val suspendContext = evaluationContext.suspendContext as? SuspendContextImpl ?: return null
if (!debugProcess.isEvaluationPossible(suspendContext)) return null
val state = evaluationContext.computeAndKeep {
DebuggerUtilsImpl.invokeClassMethod(evaluationContext, supportClass, GET_STATE_METHOD_NAME, GET_STATE_METHOD_SIGNATURE) as? ObjectReference
DebuggerUtilsImpl.invokeClassMethod(evaluationContext, supportClass, GET_STATE_METHOD_NAME, GET_STATE_METHOD_SIGNATURE, emptyList()) as? ObjectReference
} ?: return null
val stateClass = state.referenceType()