1 package net.sourceforge.phpeclipse.xdebug.php.model;
4 import net.sourceforge.phpeclipse.xdebug.php.model.XDebugVariable;
6 import org.eclipse.debug.core.DebugException;
7 import org.eclipse.debug.core.model.IDebugElement;
8 import org.eclipse.debug.core.model.IWatchExpressionDelegate;
9 import org.eclipse.debug.core.model.IWatchExpressionListener;
10 import org.eclipse.debug.core.model.IWatchExpressionResult;
11 import org.w3c.dom.Node;
13 public class XDebugWatchExpressionDelegate implements IWatchExpressionDelegate {
14 public void evaluateExpression(String expression, IDebugElement context, IWatchExpressionListener listener) {
15 IWatchExpressionResult x = new XDebugWatchExpressionResult(expression, null, null);
17 /* Active debug session */
18 if (context instanceof XDebugStackFrame) {
19 XDebugStackFrame frame = (XDebugStackFrame)context;
20 Node evalProperty = null;
23 evalProperty = frame.eval(expression);
24 } catch (Exception e) {
29 XDebugVariable variable = null;
31 variable = new XDebugVariable(frame, evalProperty);
32 x = new XDebugWatchExpressionResult(expression, variable.getValue(), null);
33 } catch (DebugException e) {
34 // TODO Auto-generated catch block
39 listener.watchEvaluationFinished(x);