author | Eugene Ostroukhov <eugeneo@symbian.org> |
Thu, 18 Mar 2010 11:56:59 -0700 | |
changeset 276 | f2f4a1259de8 |
parent 115 | d367ed1b2991 |
child 355 | 8726e95bcbba |
permissions | -rw-r--r-- |
2 | 1 |
// Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 |
// Use of this source code is governed by a BSD-style license that can be |
|
3 |
// found in the LICENSE file. |
|
4 |
||
5 |
package org.chromium.debug.core.model; |
|
6 |
||
7 |
import java.util.ArrayList; |
|
8 |
import java.util.Collection; |
|
9 |
import java.util.Collections; |
|
52
f577ea64429e
Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
10 |
import java.util.Comparator; |
2 | 11 |
import java.util.List; |
276
f2f4a1259de8
Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
115
diff
changeset
|
12 |
import java.util.Set; |
2 | 13 |
|
14 |
import org.chromium.debug.core.ChromiumDebugPlugin; |
|
15 |
import org.chromium.sdk.CallFrame; |
|
52
f577ea64429e
Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
16 |
import org.chromium.sdk.DebugContext; |
2 | 17 |
import org.chromium.sdk.JsArray; |
18 |
import org.chromium.sdk.JsFunction; |
|
19 |
import org.chromium.sdk.JsObject; |
|
20 |
import org.chromium.sdk.JsScope; |
|
21 |
import org.chromium.sdk.JsValue; |
|
22 |
import org.chromium.sdk.JsVariable; |
|
23 |
import org.chromium.sdk.Script; |
|
24 |
import org.chromium.sdk.internal.tools.v8.MethodIsBlockingException; |
|
25 |
import org.eclipse.core.runtime.IStatus; |
|
26 |
import org.eclipse.core.runtime.Status; |
|
27 |
import org.eclipse.debug.core.DebugException; |
|
28 |
import org.eclipse.debug.core.model.IRegisterGroup; |
|
29 |
import org.eclipse.debug.core.model.IStackFrame; |
|
30 |
import org.eclipse.debug.core.model.IThread; |
|
31 |
import org.eclipse.debug.core.model.IVariable; |
|
32 |
||
33 |
/** |
|
34 |
* An IStackFrame implementation over a JsStackFrame instance. |
|
35 |
*/ |
|
36 |
public class StackFrame extends DebugElementImpl implements IStackFrame { |
|
37 |
||
38 |
private final JavascriptThread thread; |
|
39 |
||
40 |
private final CallFrame stackFrame; |
|
41 |
||
42 |
private IVariable[] variables; |
|
43 |
||
44 |
/** |
|
45 |
* Constructs a stack frame for the given handler using the FrameMirror data |
|
46 |
* from the remote V8 VM. |
|
47 |
* |
|
48 |
* @param debugTarget the global parent |
|
49 |
* @param thread for which the stack frame is created |
|
50 |
* @param stackFrame an underlying SDK stack frame |
|
51 |
*/ |
|
52
f577ea64429e
Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
52 |
public StackFrame(DebugTargetImpl debugTarget, JavascriptThread thread, CallFrame stackFrame) { |
2 | 53 |
super(debugTarget); |
54 |
this.thread = thread; |
|
55 |
this.stackFrame = stackFrame; |
|
56 |
} |
|
57 |
||
58 |
public CallFrame getCallFrame() { |
|
59 |
return stackFrame; |
|
60 |
} |
|
61 |
||
62 |
public IThread getThread() { |
|
63 |
return thread; |
|
64 |
} |
|
65 |
||
66 |
public IVariable[] getVariables() throws DebugException { |
|
67 |
if (variables == null) { |
|
68 |
try { |
|
69 |
variables = wrapScopes(getDebugTarget(), stackFrame.getVariableScopes(), |
|
70 |
stackFrame.getReceiverVariable()); |
|
71 |
} catch (RuntimeException e) { |
|
72 |
// We shouldn't throw RuntimeException from here, because calling |
|
73 |
// ElementContentProvider#update will forget to call update.done(). |
|
74 |
throw new DebugException(new Status(IStatus.ERROR, ChromiumDebugPlugin.PLUGIN_ID, |
|
75 |
"Failed to read variables", e)); //$NON-NLS-1$ |
|
76 |
} |
|
77 |
} |
|
78 |
return variables; |
|
79 |
} |
|
80 |
||
81 |
static IVariable[] wrapVariables( |
|
52
f577ea64429e
Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
82 |
DebugTargetImpl debugTarget, Collection<? extends JsVariable> jsVars, |
276
f2f4a1259de8
Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
115
diff
changeset
|
83 |
Set<? extends String> propertyNameBlackList, |
2 | 84 |
Collection <? extends JsVariable> jsInternalProperties) { |
85 |
List<Variable> vars = new ArrayList<Variable>(jsVars.size()); |
|
86 |
for (JsVariable jsVar : jsVars) { |
|
276
f2f4a1259de8
Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
115
diff
changeset
|
87 |
if (propertyNameBlackList.contains(jsVar.getName())) { |
f2f4a1259de8
Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
115
diff
changeset
|
88 |
continue; |
f2f4a1259de8
Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
115
diff
changeset
|
89 |
} |
2 | 90 |
vars.add(new Variable(debugTarget, jsVar, false)); |
91 |
} |
|
52
f577ea64429e
Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
92 |
// Sort all regular properties by name. |
f577ea64429e
Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
93 |
Collections.sort(vars, VARIABLE_COMPARATOR); |
f577ea64429e
Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
94 |
// Always put internal properties in the end. |
276
f2f4a1259de8
Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
115
diff
changeset
|
95 |
if (jsInternalProperties != null) { |
f2f4a1259de8
Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
115
diff
changeset
|
96 |
for (JsVariable jsMetaVar : jsInternalProperties) { |
f2f4a1259de8
Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
115
diff
changeset
|
97 |
vars.add(new Variable(debugTarget, jsMetaVar, true)); |
f2f4a1259de8
Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
115
diff
changeset
|
98 |
} |
2 | 99 |
} |
100 |
return vars.toArray(new IVariable[vars.size()]); |
|
101 |
} |
|
102 |
||
52
f577ea64429e
Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
103 |
static IVariable[] wrapScopes(DebugTargetImpl debugTarget, List<? extends JsScope> jsScopes, |
2 | 104 |
JsVariable receiverVariable) { |
105 |
List<Variable> vars = new ArrayList<Variable>(); |
|
106 |
||
107 |
for (JsScope scope : jsScopes) { |
|
108 |
if (scope.getType() == JsScope.Type.GLOBAL) { |
|
109 |
if (receiverVariable != null) { |
|
110 |
vars.add(new Variable(debugTarget, receiverVariable, false)); |
|
111 |
receiverVariable = null; |
|
112 |
} |
|
113 |
vars.add(new Variable(debugTarget, wrapScopeAsVariable(scope), false)); |
|
114 |
} else { |
|
52
f577ea64429e
Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
115 |
int startPos = vars.size(); |
2 | 116 |
for (JsVariable var : scope.getVariables()) { |
117 |
vars.add(new Variable(debugTarget, var, false)); |
|
118 |
} |
|
52
f577ea64429e
Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
119 |
int endPos = vars.size(); |
f577ea64429e
Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
120 |
List<Variable> sublist = vars.subList(startPos, endPos); |
f577ea64429e
Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
121 |
Collections.sort(sublist, VARIABLE_COMPARATOR); |
2 | 122 |
} |
123 |
} |
|
124 |
if (receiverVariable != null) { |
|
125 |
vars.add(new Variable(debugTarget, receiverVariable, false)); |
|
126 |
} |
|
127 |
||
128 |
IVariable[] result = new IVariable[vars.size()]; |
|
129 |
// Return in reverse order. |
|
130 |
for (int i = 0; i < result.length; i++) { |
|
131 |
result[result.length - i - 1] = vars.get(i); |
|
132 |
} |
|
133 |
return result; |
|
134 |
} |
|
135 |
||
136 |
private static JsVariable wrapScopeAsVariable(final JsScope jsScope) { |
|
137 |
class ScopeObjectVariable implements JsVariable, JsObject { |
|
138 |
public String getFullyQualifiedName() { |
|
139 |
return getName(); |
|
140 |
} |
|
141 |
public String getName() { |
|
142 |
// TODO(peter.rybin): should we localize it? |
|
143 |
return "<" + jsScope.getType() + ">"; |
|
144 |
} |
|
145 |
public JsValue getValue() throws UnsupportedOperationException { |
|
146 |
return this; |
|
147 |
} |
|
148 |
public boolean isMutable() { |
|
149 |
return false; |
|
150 |
} |
|
151 |
public boolean isReadable() { |
|
152 |
return true; |
|
153 |
} |
|
154 |
public void setValue(String newValue, SetValueCallback callback) |
|
155 |
throws UnsupportedOperationException { |
|
156 |
throw new UnsupportedOperationException(); |
|
157 |
} |
|
158 |
public JsArray asArray() { |
|
159 |
return null; |
|
160 |
} |
|
161 |
public JsFunction asFunction() { |
|
162 |
return null; |
|
163 |
} |
|
164 |
public String getClassName() { |
|
165 |
// TODO(peter.rybin): should we localize it? |
|
166 |
return "#Scope"; |
|
167 |
} |
|
168 |
public Collection<? extends JsVariable> getProperties() throws MethodIsBlockingException { |
|
169 |
return jsScope.getVariables(); |
|
170 |
} |
|
171 |
public Collection<? extends JsVariable> getInternalProperties() |
|
172 |
throws MethodIsBlockingException { |
|
173 |
return Collections.emptyList(); |
|
174 |
} |
|
175 |
public JsVariable getProperty(String name) { |
|
176 |
for (JsVariable var : getProperties()) { |
|
177 |
if (var.getName().equals(name)) { |
|
178 |
return var; |
|
179 |
} |
|
180 |
} |
|
181 |
return null; |
|
182 |
} |
|
183 |
public JsObject asObject() { |
|
184 |
return this; |
|
185 |
} |
|
186 |
public Type getType() { |
|
187 |
return Type.TYPE_OBJECT; |
|
188 |
} |
|
189 |
public String getValueString() { |
|
190 |
return getClassName(); |
|
191 |
} |
|
192 |
public String getRefId() { |
|
193 |
return null; |
|
194 |
} |
|
195 |
} |
|
196 |
return new ScopeObjectVariable(); |
|
197 |
} |
|
198 |
||
199 |
public boolean hasVariables() throws DebugException { |
|
200 |
return stackFrame.getReceiverVariable() != null || stackFrame.getVariableScopes().size() > 0; |
|
201 |
} |
|
202 |
||
203 |
public int getLineNumber() throws DebugException { |
|
115
d367ed1b2991
Bug 1665 (HTML Files Cannot be Debugged) was fixed
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
52
diff
changeset
|
204 |
return getDebugTarget().getLineNumber(stackFrame); |
2 | 205 |
} |
206 |
||
207 |
public int getCharStart() throws DebugException { |
|
208 |
return stackFrame.getCharStart(); |
|
209 |
} |
|
210 |
||
211 |
public int getCharEnd() throws DebugException { |
|
212 |
return -1; |
|
213 |
} |
|
214 |
||
215 |
public String getName() throws DebugException { |
|
52
f577ea64429e
Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
216 |
return getDebugTarget().getLabelProvider().getStackFrameLabel(this); |
2 | 217 |
} |
218 |
||
219 |
public IRegisterGroup[] getRegisterGroups() throws DebugException { |
|
220 |
return null; |
|
221 |
} |
|
222 |
||
223 |
public boolean hasRegisterGroups() throws DebugException { |
|
224 |
return false; |
|
225 |
} |
|
226 |
||
227 |
public boolean canStepInto() { |
|
228 |
return getThread().canStepInto(); |
|
229 |
} |
|
230 |
||
231 |
public boolean canStepOver() { |
|
232 |
return getThread().canStepOver(); |
|
233 |
} |
|
234 |
||
235 |
public boolean canStepReturn() { |
|
236 |
return getThread().canStepReturn(); |
|
237 |
} |
|
238 |
||
239 |
public boolean isStepping() { |
|
240 |
return getThread().isStepping(); |
|
241 |
} |
|
242 |
||
243 |
public void stepInto() throws DebugException { |
|
244 |
getThread().stepInto(); |
|
245 |
} |
|
246 |
||
247 |
public void stepOver() throws DebugException { |
|
248 |
getThread().stepOver(); |
|
249 |
} |
|
250 |
||
251 |
public void stepReturn() throws DebugException { |
|
252 |
getThread().stepReturn(); |
|
253 |
} |
|
254 |
||
255 |
public boolean canResume() { |
|
256 |
return getThread().canResume(); |
|
257 |
} |
|
258 |
||
259 |
public boolean canSuspend() { |
|
260 |
return getThread().canSuspend(); |
|
261 |
} |
|
262 |
||
263 |
public boolean isSuspended() { |
|
264 |
return getThread().isSuspended(); |
|
265 |
} |
|
266 |
||
267 |
public void resume() throws DebugException { |
|
268 |
getThread().resume(); |
|
269 |
} |
|
270 |
||
271 |
public void suspend() throws DebugException { |
|
272 |
getThread().suspend(); |
|
273 |
} |
|
274 |
||
275 |
public boolean canTerminate() { |
|
276 |
return getThread().canTerminate(); |
|
277 |
} |
|
278 |
||
279 |
public boolean isTerminated() { |
|
280 |
return getThread().isTerminated(); |
|
281 |
} |
|
282 |
||
283 |
public void terminate() throws DebugException { |
|
284 |
getThread().terminate(); |
|
285 |
} |
|
286 |
||
287 |
/** |
|
288 |
* Returns the name of the source file this stack frame is associated with. |
|
289 |
* |
|
290 |
* @return the name of the source file this stack frame is associated with |
|
291 |
*/ |
|
292 |
String getSourceName() { |
|
293 |
Script script = stackFrame.getScript(); |
|
294 |
if (script == null) { |
|
295 |
return Messages.StackFrame_UnknownScriptName; |
|
296 |
} |
|
297 |
return script.getName(); |
|
298 |
} |
|
299 |
||
300 |
@Override |
|
301 |
public boolean equals(Object obj) { |
|
302 |
if (obj instanceof StackFrame) { |
|
303 |
StackFrame other = (StackFrame) obj; |
|
304 |
return other.stackFrame.equals(this.stackFrame); |
|
305 |
} |
|
306 |
return false; |
|
307 |
} |
|
308 |
||
309 |
@Override |
|
310 |
public int hashCode() { |
|
311 |
return stackFrame.hashCode(); |
|
312 |
} |
|
313 |
||
52
f577ea64429e
Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
314 |
private final static Comparator<Variable> VARIABLE_COMPARATOR = new Comparator<Variable>() { |
f577ea64429e
Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
315 |
public int compare(Variable var1, Variable var2) { |
276
f2f4a1259de8
Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
115
diff
changeset
|
316 |
return compareNameObjects(getNameObject(var1), getNameObject(var2)); |
f2f4a1259de8
Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
115
diff
changeset
|
317 |
} |
f2f4a1259de8
Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
115
diff
changeset
|
318 |
// Get property name as String or Integer. |
f2f4a1259de8
Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
115
diff
changeset
|
319 |
private Object getNameObject(Variable var) { |
f2f4a1259de8
Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
115
diff
changeset
|
320 |
String name = var.getName(); |
f2f4a1259de8
Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
115
diff
changeset
|
321 |
int len = name.length(); |
f2f4a1259de8
Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
115
diff
changeset
|
322 |
if (len >= 3 && name.charAt(0) == '[' && name.charAt(len-1) == ']') { |
f2f4a1259de8
Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
115
diff
changeset
|
323 |
Integer i = Integer.valueOf(name.substring(1, len - 1)); |
f2f4a1259de8
Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
115
diff
changeset
|
324 |
return i; |
f2f4a1259de8
Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
115
diff
changeset
|
325 |
} |
f2f4a1259de8
Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
115
diff
changeset
|
326 |
return name; |
52
f577ea64429e
Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
327 |
} |
276
f2f4a1259de8
Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
115
diff
changeset
|
328 |
// Compare property name (either string or integer). |
f2f4a1259de8
Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
115
diff
changeset
|
329 |
private int compareNameObjects(Object nameObj1, Object nameObj2) { |
f2f4a1259de8
Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
115
diff
changeset
|
330 |
if (nameObj1 instanceof Integer) { |
f2f4a1259de8
Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
115
diff
changeset
|
331 |
Integer i1 = (Integer) nameObj1; |
f2f4a1259de8
Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
115
diff
changeset
|
332 |
if (nameObj2 instanceof Integer) { |
f2f4a1259de8
Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
115
diff
changeset
|
333 |
Integer i2 = (Integer) nameObj2; |
f2f4a1259de8
Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
115
diff
changeset
|
334 |
return i1.compareTo(i2); |
f2f4a1259de8
Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
115
diff
changeset
|
335 |
} else { |
f2f4a1259de8
Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
115
diff
changeset
|
336 |
return COMPARE_INT_WITH_STRING; |
f2f4a1259de8
Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
115
diff
changeset
|
337 |
} |
f2f4a1259de8
Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
115
diff
changeset
|
338 |
} else { |
f2f4a1259de8
Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
115
diff
changeset
|
339 |
String s1 = (String) nameObj1; |
f2f4a1259de8
Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
115
diff
changeset
|
340 |
if (nameObj2 instanceof String) { |
f2f4a1259de8
Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
115
diff
changeset
|
341 |
String s2 = (String) nameObj2; |
f2f4a1259de8
Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
115
diff
changeset
|
342 |
return s1.compareTo(s2); |
f2f4a1259de8
Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
115
diff
changeset
|
343 |
} else { |
f2f4a1259de8
Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
115
diff
changeset
|
344 |
return -COMPARE_INT_WITH_STRING; |
f2f4a1259de8
Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
115
diff
changeset
|
345 |
} |
f2f4a1259de8
Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
115
diff
changeset
|
346 |
} |
f2f4a1259de8
Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
115
diff
changeset
|
347 |
} |
f2f4a1259de8
Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
115
diff
changeset
|
348 |
// Strings go before numbers. |
f2f4a1259de8
Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
115
diff
changeset
|
349 |
private static final int COMPARE_INT_WITH_STRING = 1; |
52
f577ea64429e
Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
350 |
}; |
f577ea64429e
Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
351 |
|
f577ea64429e
Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
352 |
@Override |
f577ea64429e
Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
353 |
@SuppressWarnings("unchecked") |
f577ea64429e
Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
354 |
public Object getAdapter(Class adapter) { |
f577ea64429e
Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
355 |
if (adapter == EvaluateContext.class) { |
f577ea64429e
Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
356 |
DebugContext debugContext = getDebugTarget().getDebugContext(); |
f577ea64429e
Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
357 |
if (debugContext == null) { |
f577ea64429e
Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
358 |
return null; |
f577ea64429e
Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
359 |
} |
f577ea64429e
Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
360 |
return new EvaluateContext(getCallFrame().getEvaluateContext(), getDebugTarget()); |
f577ea64429e
Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
361 |
} |
f577ea64429e
Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
362 |
return super.getAdapter(adapter); |
f577ea64429e
Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
363 |
} |
2 | 364 |
} |