JetBrains/intellij-community · error · EvaluateException

Variable doesn't belong to this frame: {localVariable}

Error message

Variable doesn't belong to this frame: {localVariable}

What it means

Error "Variable doesn't belong to this frame: {localVariable}" thrown in JetBrains/intellij-community.

Source

Thrown at java/debugger/impl/src/com/intellij/debugger/jdi/StackFrameProxyImpl.java:400

        }
        catch (InvalidStackFrameException e) {
          error = e;
          clearCaches();
        }
      }
      catch (InvalidStackFrameException | AbsentInformationException e) {
        throw EvaluateExceptionUtil.createEvaluateException(e);
      }
    }
    throw new EvaluateException(error.getMessage(), error);
  }

  @Override
  public Value getVariableValue(@NotNull LocalVariableProxy localVariable) throws EvaluateException {
    if (localVariable instanceof LocalVariableProxyImpl) {
      return getValue((LocalVariableProxyImpl)localVariable);
    }
    throw new EvaluateException("Variable doesn't belong to this frame: " + localVariable);
  }

  public Value getValue(LocalVariableProxyImpl localVariable) throws EvaluateException {
    DebuggerManagerThreadImpl.assertIsManagerThread();
    Exception error = null;
    for (int attempt = 0; attempt < 2; attempt++) {
      try {
        LocalVariable variable = localVariable.getVariable();
        Map<LocalVariable, Value> values;
        try {
          values = getAllValues();
        }
        catch (InconsistentDebugInfoException ignored) {
          // possibly failed due to one of the variables, try getting one by one
          return getSingleValue(variable);
        }

        if (values.containsKey(variable)) {

View on GitHub (pinned to be881553f2)

Solutions

  1. Recompile the affected class so the local variable table matches the code, then restart the debug session.
  2. Avoid hot-swapped or instrumented classes whose debug info no longer matches the frame.

Example fix

Build | Rebuild Project, restart the debug session, and evaluate the variable again.

When it happens

Trigger: The debugger maps a local variable to a stack frame whose debug information does not contain it.

Common situations: Stale or mismatched class files (e.g. after hot swap or partial recompilation) desynchronizing the LocalVariableTable.


AI-assisted analysis of JetBrains/intellij-community@be881553f2 (2026-08-14). Data as JSON: /api/errors/da98c2be818bf093. Report an issue: GitHub.