1 package net.sourceforge.phpdt.internal.debug.core.watch;
3 import net.sourceforge.phpdt.internal.debug.core.PHPDBGProxy;
4 import net.sourceforge.phpdt.internal.debug.core.model.PHPDebugTarget;
5 import net.sourceforge.phpdt.internal.debug.core.model.PHPStackFrame;
6 import net.sourceforge.phpdt.internal.debug.core.model.PHPVariable;
8 import org.eclipse.debug.core.model.IDebugElement;
9 import org.eclipse.debug.core.model.IWatchExpressionDelegate;
10 import org.eclipse.debug.core.model.IWatchExpressionListener;
11 import org.eclipse.debug.core.model.IWatchExpressionResult;
16 public class PHPWatchExpressionDelegate implements IWatchExpressionDelegate {
18 public void evaluateExpression(String expression, IDebugElement context,
19 IWatchExpressionListener listener) {
20 IWatchExpressionResult x;
24 dbg = ((PHPDebugTarget) context.getDebugTarget()).getPHPDBGProxy();
27 if (context instanceof PHPStackFrame) {
28 s = (PHPStackFrame) context;
32 PHPVariable result[] = dbg.eval(s, expression);
34 if (result.length == 0) {
35 x = new PHPWatchExpressionResult(expression, null, null);
37 x = new PHPWatchExpressionResult(expression, result[0]
40 } catch (Exception e) {
45 x = new PHPWatchExpressionResult(expression, null, s1);
48 listener.watchEvaluationFinished(x);