@Nullable
  private static ObjectReference getTargetExceptionWithStackTraceFilled(@Nullable EvaluationContextImpl evaluationContext,
                                                                        EvaluateException ex,
                                                                        boolean printToConsole) {
    final ObjectReference exceptionObj = ex.getExceptionFromTargetVM();
    if (exceptionObj != null && evaluationContext != null) {
      try {
        Value trace = invokeExceptionGetStackTrace(exceptionObj, evaluationContext);

        // print to console as well
        if (printToConsole && trace instanceof ArrayReference) {
          evaluationContext.getDebugProcess().printToConsole(DebuggerUtilsImpl.getExceptionText(evaluationContext, exceptionObj));
        }
      }
      catch (EvaluateException ignored) {
      }
      catch (Throwable e) {
        LOG.info(e); // catch all exceptions to ensure the method returns gracefully
      }
    }
    return exceptionObj;
  }
@Nullable
  private static ObjectReference getTargetExceptionWithStackTraceFilled(@Nullable EvaluationContextImpl evaluationContext,
                                                                        EvaluateException ex,
                                                                        boolean printToConsole)