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, IWatchExpressionListener listener) {
19 IWatchExpressionResult x;
23 dbg = ((PHPDebugTarget) context.getDebugTarget ()).getPHPDBGProxy ();
26 if (context instanceof PHPStackFrame) {
27 s = (PHPStackFrame) context;
31 PHPVariable result[] = dbg.eval (s, expression);
33 if (result.length == 0) {
34 x = new PHPWatchExpressionResult (expression, null, null);
37 x = new PHPWatchExpressionResult (expression, result[0].getValue (), null);
44 s1[0] = e.toString ();
45 x = new PHPWatchExpressionResult (expression, null, s1);
48 listener.watchEvaluationFinished (x);