}
}
public void evaluateExpression(final String expression, final IDebugElement context,
final IWatchExpressionListener listener) {
final DebugElementImpl contextImpl = (DebugElementImpl) context;
if (!contextImpl.getDebugTarget().isSuspended()) {
// can only evaluate while suspended. Notify empty result.
listener.watchEvaluationFinished(new IWatchExpressionResult() {
public String[] getErrorMessages() {
return EMPTY_STRINGS;
}
public DebugException getException() {
return null;
}
public String getExpressionText() {
return expression;
}
public IValue getValue() {
return null;
}
public boolean hasErrors() {
return false;
}
});
return;
}
final EvaluateContext evaluateContext =
(EvaluateContext) contextImpl.getAdapter(EvaluateContext.class);
if (evaluateContext == null) {
listener.watchEvaluationFinished(new BadWatchExpressionResult(
new DebugException(new Status(Status.ERROR,
ChromiumDebugUIPlugin.PLUGIN_ID,"Bad debug context")), //$NON-NLS-1$
expression));