public EvaluationUi(@NotNull DebugSession session, boolean autoUpdate) { super(new BorderLayout()); myDebugSession = session; myAutoUpdate = autoUpdate; myDebugSession.addChangeListener(mySessionChangeAdapter); myTree = new EvaluationTree(); }
protected void evaluate(final AbstractEvaluationModel model) { if (!(myDebugSession.getEvaluationProvider().canEvaluate())) { setErrorText("Program should be paused on breakpoint to evaluate"); return; } try { final Class clazz = model.generateAndLoadEvaluatorClass(); setEvaluating(model); myDebugSession .getEventsProcessor() .scheduleEvaluation( new _FunctionTypes._void_P0_E0() { public void invoke() { try { Evaluator evaluator = model.createEvaluatorInstance(clazz); IValueProxy evaluatedValue = evaluator.evaluate(); if (evaluatedValue != null) { setSuccess(evaluatedValue, model); } else { setFailure(null, "Evaluation returned null.", model); } } catch (EvaluationException e) { setFailure(e, null, model); } catch (Throwable t) { setFailure(t, null, model); LOG.error(t); } } }, check_4q63yg_b0a2a1a11(myDebugSession.getUiState().getThread())); } catch (InvalidEvaluatedExpressionException e) { setFailure(e.getCause(), null, model); } catch (InvocationTargetEvaluationException e) { setFailure(e.getCause(), null, model); LOG.error(e.getCause()); } catch (EvaluationException e) { setFailure(e, null, model); } catch (Throwable t) { setFailure(t, null, model); LOG.error(t); } }
public void dispose() { myDebugSession.removeChangeListener(mySessionChangeAdapter); myTree.dispose(); }