--- a/org.chromium.debug.ui/src/org/chromium/debug/ui/JsWatchExpressionDelegate.java Wed Jan 27 10:42:14 2010 -0800
+++ b/org.chromium.debug.ui/src/org/chromium/debug/ui/JsWatchExpressionDelegate.java Wed Jan 27 15:45:27 2010 -0800
@@ -6,9 +6,9 @@
import org.chromium.debug.core.ChromiumDebugPlugin;
import org.chromium.debug.core.model.DebugElementImpl;
-import org.chromium.debug.core.model.StackFrame;
+import org.chromium.debug.core.model.EvaluateContext;
import org.chromium.debug.core.model.Variable;
-import org.chromium.sdk.CallFrame;
+import org.chromium.sdk.JsEvaluateContext;
import org.chromium.sdk.JsVariable;
import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.DebugException;
@@ -133,30 +133,34 @@
});
return;
}
- if (!(contextImpl instanceof StackFrame)) {
+
+ 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));
return;
}
- StackFrame stackFrame = (StackFrame) contextImpl;
- final CallFrame frame = stackFrame.getCallFrame();
- frame.evaluateAsync(expression, new CallFrame.EvaluateCallback() {
- public void success(JsVariable variable) {
- final Variable var = new Variable(contextImpl.getDebugTarget(), variable, false);
- listener.watchEvaluationFinished(new GoodWatchExpressionResult(var, expression));
- }
+
+ evaluateContext.getJsEvaluateContext().evaluateAsync(
+ expression,
+ new JsEvaluateContext.EvaluateCallback() {
+ public void success(JsVariable variable) {
+ final Variable var = new Variable(contextImpl.getDebugTarget(), variable, false);
+ listener.watchEvaluationFinished(new GoodWatchExpressionResult(var, expression));
+ }
- public void failure(String message) {
- listener.watchEvaluationFinished(new BadWatchExpressionResult(new DebugException(
- createErrorStatus(message == null
- ? Messages.JsWatchExpressionDelegate_ErrorEvaluatingExpression
- : message, null)), expression));
- return;
- }
- },
- null);
+ public void failure(String message) {
+ listener.watchEvaluationFinished(new BadWatchExpressionResult(new DebugException(
+ createErrorStatus(message == null
+ ? Messages.JsWatchExpressionDelegate_ErrorEvaluatingExpression
+ : message, null)), expression));
+ return;
+ }
+ },
+ null);
}
private static Status createErrorStatus(String message, Exception e) {