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;
13 public class PHPWatchExpressionDelegate implements IWatchExpressionDelegate {
15 public void evaluateExpression(String expression, IDebugElement context,
16 IWatchExpressionListener listener) {
17 IWatchExpressionResult x;
18 PHPDBGProxy dbg=((PHPDebugTarget)context.getDebugTarget()).getPHPDBGProxy();
20 if(context instanceof PHPStackFrame)
21 s=(PHPStackFrame)context;
23 PHPVariable result[]=dbg.eval(s,expression);
25 x=new PHPWatchExpressionResult(expression,null,null);
27 x=new PHPWatchExpressionResult(expression,result[0].getValue(),null);
31 String[] s1=new String[1];
33 x=new PHPWatchExpressionResult(expression,null,s1);
35 listener.watchEvaluationFinished(x);