Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2014-12-20 12:41:54 -0500
committerEugene Tarassov2014-12-20 12:41:54 -0500
commit2527a1461914634b9164fc47756bda97598e80a4 (patch)
tree4df49239b86d2912bafe7160c9c0235eab13cd49 /plugins/org.eclipse.tcf.debug.ui
parent726b2f113eaeeff2e9d04ed2ef08915987266f2f (diff)
downloadorg.eclipse.tcf-2527a1461914634b9164fc47756bda97598e80a4.tar.gz
org.eclipse.tcf-2527a1461914634b9164fc47756bda97598e80a4.tar.xz
org.eclipse.tcf-2527a1461914634b9164fc47756bda97598e80a4.zip
TCF Debugger: added symbol location info cache
Diffstat (limited to 'plugins/org.eclipse.tcf.debug.ui')
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFChildrenSubExpressions.java15
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java13
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeSymbol.java44
3 files changed, 60 insertions, 12 deletions
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFChildrenSubExpressions.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFChildrenSubExpressions.java
index 8c1848e59..2e657936b 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFChildrenSubExpressions.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFChildrenSubExpressions.java
@@ -106,8 +106,6 @@ public class TCFChildrenSubExpressions extends TCFChildren {
if (sym_data == null) continue;
switch (sym_data.getSymbolClass()) {
case reference:
- case variant_part:
- case variant:
if (sym_data.getFlag(ISymbols.SYM_FLAG_ARTIFICIAL)) continue;
if (sym_data.getName() == null && !sym_data.getFlag(ISymbols.SYM_FLAG_INHERITANCE)) {
if (!findFields(sym_data, map, deref)) return false;
@@ -118,6 +116,19 @@ public class TCFChildrenSubExpressions extends TCFChildren {
map.put(n.id, n);
}
break;
+ case variant_part:
+ if (!findFields(sym_data, map, deref)) return false;
+ break;
+ case variant:
+ TCFDataCache<Map<String,Object>> sym_loc_cache = node.model.getSymbolLocationCache(id);
+ if (!sym_loc_cache.validate()) {
+ pending = sym_loc_cache;
+ continue;
+ }
+ // Map<String,Object> sym_loc_data = sym_loc_cache.getData();
+ // TODO: filter out fields according to discriminant info
+ if (!findFields(sym_data, map, deref)) return false;
+ break;
default:
break;
}
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java
index df7aa03cd..d141a12bf 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java
@@ -1318,6 +1318,19 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
}
/**
+ * Get a data cache that contains location info of a symbol.
+ * New cache object is created if it does not exist yet.
+ * @param sym_id - the symbol ID.
+ * @return data cache object.
+ */
+ public TCFDataCache<Map<String,Object>> getSymbolLocationCache(final String sym_id) {
+ if (sym_id == null) return null;
+ TCFNodeSymbol n = (TCFNodeSymbol)getNode(sym_id);
+ if (n == null) n = new TCFNodeSymbol(launch_node, sym_id);
+ return n.getLocation();
+ }
+
+ /**
* Search memory context that owns the object represented by given node.
* @return data cache item that holds the memory context node.
*/
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeSymbol.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeSymbol.java
index b3e6bd37c..db4e2e184 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeSymbol.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeSymbol.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 Wind River Systems, Inc. and others.
+ * Copyright (c) 2010, 2014 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.tcf.internal.debug.ui.model;
+import java.util.Map;
+
import org.eclipse.tcf.protocol.IToken;
import org.eclipse.tcf.protocol.Protocol;
import org.eclipse.tcf.services.ISymbols;
@@ -19,6 +21,7 @@ public class TCFNodeSymbol extends TCFNode {
private final TCFData<ISymbols.Symbol> context;
private final TCFData<String[]> children;
+ private final TCFData<Map<String,Object>> location;
private int update_policy;
private ISymbolOwner owner;
@@ -67,6 +70,23 @@ public class TCFNodeSymbol extends TCFNode {
return false;
}
};
+ location = new TCFData<Map<String,Object>>(channel) {
+ @Override
+ protected boolean startDataRetrieval() {
+ ISymbols syms = launch.getService(ISymbols.class);
+ if (id == null || syms == null) {
+ set(null, null, null);
+ return true;
+ }
+ command = syms.getLocationInfo(id, new ISymbols.DoneGetLocationInfo() {
+ @Override
+ public void doneGetLocationInfo(IToken token, Exception error, Map<String,Object> props) {
+ set(token, error, props);
+ }
+ });
+ return false;
+ }
+ };
setUpdatePolicy(null, 0);
if (sym_list == null) {
prev = next = this;
@@ -123,7 +143,7 @@ public class TCFNodeSymbol extends TCFNode {
super.dispose();
}
- public TCFDataCache<ISymbols.Symbol> getContext() {
+ private void moveUp() {
if (sym_list != this) {
prev.next = next;
next.prev = prev;
@@ -132,21 +152,23 @@ public class TCFNodeSymbol extends TCFNode {
prev.next = next.prev = this;
sym_list = this;
}
+ }
+
+ public TCFDataCache<ISymbols.Symbol> getContext() {
+ moveUp();
return context;
}
public TCFDataCache<String[]> getChildren() {
- if (sym_list != this) {
- prev.next = next;
- next.prev = prev;
- prev = sym_list;
- next = sym_list.next;
- prev.next = next.prev = this;
- sym_list = this;
- }
+ moveUp();
return children;
}
+ public TCFData<Map<String,Object>> getLocation() {
+ moveUp();
+ return location;
+ }
+
private void setUpdatePolicy(String id, int policy) {
update_policy = policy;
if (!isDisposed()) {
@@ -163,11 +185,13 @@ public class TCFNodeSymbol extends TCFNode {
void onMemoryMapChanged() {
context.reset();
children.reset();
+ location.reset();
}
void onExeStateChange() {
if (update_policy == ISymbols.UPDATE_ON_MEMORY_MAP_CHANGES) return;
context.reset();
children.reset();
+ location.reset();
}
}

Back to the top