Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(434)

Unified Diff: dart/editor/tools/plugins/com.google.dart.tools.debug.core/src/com/google/dart/tools/debug/core/dartium/DartiumDebugStackFrame.java

Issue 64033002: Version 0.8.10.8 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: dart/editor/tools/plugins/com.google.dart.tools.debug.core/src/com/google/dart/tools/debug/core/dartium/DartiumDebugStackFrame.java
===================================================================
--- dart/editor/tools/plugins/com.google.dart.tools.debug.core/src/com/google/dart/tools/debug/core/dartium/DartiumDebugStackFrame.java (revision 30037)
+++ dart/editor/tools/plugins/com.google.dart.tools.debug.core/src/com/google/dart/tools/debug/core/dartium/DartiumDebugStackFrame.java (working copy)
@@ -63,6 +63,9 @@
private VariableCollector variableCollector = VariableCollector.empty();
+ private IValue classValue;
+ private IValue globalScopeValue;
+
public DartiumDebugStackFrame(IDebugTarget target, IThread thread, WebkitCallFrame webkitFrame) {
this(target, thread, webkitFrame, null);
}
@@ -168,30 +171,20 @@
return var;
}
}
+ }
- // search statics for an instance method
- if (thisValue instanceof DartiumDebugValue) {
- IValue classValue = ((DartiumDebugValue) thisValue).getClassValue();
-
- if (classValue != null) {
- for (IVariable var : classValue.getVariables()) {
- if (var.getName().equals(varName)) {
- return var;
- }
- }
+ // search statics
+ if (getClassValue() != null) {
+ for (IVariable var : getClassValue().getVariables()) {
+ if (var.getName().equals(varName)) {
+ return var;
}
}
- } else {
- // TODO(devoncarew): search in statics in a class function
- // This will require a change to the WIP protocol.
-
}
// search globals
- IVariable globalVar = getGlobalVariable();
-
- if (globalVar != null) {
- for (IVariable var : globalVar.getValue().getVariables()) {
+ if (getGlobalsScope() != null) {
+ for (IVariable var : getGlobalsScope().getVariables()) {
if (var.getName().equals(varName)) {
return var;
}
@@ -436,18 +429,36 @@
return null;
}
- protected IVariable getGlobalVariable() throws DebugException {
- for (IVariable var : getVariables()) {
- if (var instanceof DartiumDebugVariable) {
- if (((DartiumDebugVariable) var).isLibraryObject()) {
- return var;
- }
+ protected IValue getClassValue() throws DebugException {
+ if (classValue != null) {
+ return classValue;
+ }
+
+ for (WebkitScope scope : webkitFrame.getScopeChain()) {
+ if (scope.isClass()) {
+ classValue = new DartiumDebugValue(getTarget(), null, scope.getObject());
+ break;
}
}
- return null;
+ return classValue;
}
+ protected IValue getGlobalsScope() throws DebugException {
+ if (globalScopeValue != null) {
+ return globalScopeValue;
+ }
+
+ for (WebkitScope scope : webkitFrame.getScopeChain()) {
+ if (scope.isGlobal()) {
+ globalScopeValue = new DartiumDebugValue(getTarget(), null, scope.getObject());
+ break;
+ }
+ }
+
+ return globalScopeValue;
+ }
+
protected String getMappedLocationPath() {
SourceMapManager.SourceLocation targetLocation = getMappedLocation();

Powered by Google App Engine
This is Rietveld 408576698