Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFChildrenExecContext.java14
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeExecContext.java22
2 files changed, 29 insertions, 7 deletions
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFChildrenExecContext.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFChildrenExecContext.java
index 918af4aba..231c39e02 100644
--- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFChildrenExecContext.java
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFChildrenExecContext.java
@@ -44,10 +44,13 @@ public class TCFChildrenExecContext extends TCFChildren {
public void doneGetChildren(IToken token, Exception error, String[] contexts) {
Map<String,TCFNode> data = null;
if (command == token && error == null) {
+ int cnt = 0;
data = new HashMap<String,TCFNode>();
for (String id : contexts) {
TCFNode n = node.model.getNode(id);
if (n == null) n = new TCFNodeExecContext(node, id);
+ ((TCFNodeExecContext)n).setMemSeqNo(cnt++);
+ assert n.parent == node;
data.put(id, n);
}
}
@@ -70,10 +73,12 @@ public class TCFChildrenExecContext extends TCFChildren {
public void doneGetChildren(IToken token, Exception error, String[] contexts) {
Map<String,TCFNode> data = null;
if (command == token && error == null) {
+ int cnt = 0;
data = new HashMap<String,TCFNode>();
for (String id : contexts) {
TCFNode n = node.model.getNode(id);
if (n == null) n = new TCFNodeExecContext(node, id);
+ ((TCFNodeExecContext)n).setExeSeqNo(cnt++);
assert n.parent == node;
data.put(id, n);
}
@@ -107,6 +112,11 @@ public class TCFChildrenExecContext extends TCFChildren {
}
void onContextAdded(IRunControl.RunControlContext context) {
+ // To preserve children order need to reset children list.
+ reset();
+ run_children.reset();
+ mem_children.reset();
+ assert !node.isDisposed();
String id = context.getID();
TCFNodeExecContext n = (TCFNodeExecContext)node.model.getNode(id);
if (n == null) {
@@ -122,6 +132,10 @@ public class TCFChildrenExecContext extends TCFChildren {
}
void onContextAdded(IMemory.MemoryContext context) {
+ // To preserve children order need to reset children list.
+ reset();
+ run_children.reset();
+ mem_children.reset();
assert !node.isDisposed();
String id = context.getID();
TCFNodeExecContext n = (TCFNodeExecContext)node.model.getNode(id);
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeExecContext.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeExecContext.java
index 5aac5c109..af3127b7f 100644
--- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeExecContext.java
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeExecContext.java
@@ -45,8 +45,6 @@ import org.eclipse.tm.tcf.util.TCFDataCache;
public class TCFNodeExecContext extends TCFNode implements ISymbolOwner {
- private final int seq_no;
-
private final TCFChildrenExecContext children_exec;
private final TCFChildrenStackTrace children_stack;
private final TCFChildrenRegisters children_regs;
@@ -68,6 +66,9 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner {
private LinkedHashMap<BigInteger,TCFDataCache<TCFFunctionRef>> func_info_lookup_cache;
private LookupCacheTimer lookup_cache_timer;
+ private int mem_seq_no;
+ private int exe_seq_no;
+
/*
* LookupCacheTimer is executed periodically to dispose least-recently
* accessed entries in line_info_lookup_cache and func_info_lookup_cache.
@@ -117,8 +118,6 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner {
private String hover_expression;
- private static int seq_cnt;
-
/**
* Wrapper class for IMemoryMap.MemoryRegion.
* The class help to search memory region by address by
@@ -204,7 +203,6 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner {
TCFNodeExecContext(TCFNode parent, final String id) {
super(parent, id);
- seq_no = seq_cnt++;
children_exec = new TCFChildrenExecContext(this);
children_stack = new TCFChildrenStackTrace(this) {
@Override
@@ -429,6 +427,14 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner {
super.dispose();
}
+ void setMemSeqNo(int no) {
+ mem_seq_no = no;
+ }
+
+ void setExeSeqNo(int no) {
+ exe_seq_no = no;
+ }
+
TCFChildren getHoverExpressionCache(String expression) {
if (expression != hover_expression && (expression == null || !expression.equals(hover_expression))) {
hover_expression = expression;
@@ -1195,8 +1201,10 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner {
public int compareTo(TCFNode n) {
if (n instanceof TCFNodeExecContext) {
TCFNodeExecContext f = (TCFNodeExecContext)n;
- if (seq_no < f.seq_no) return -1;
- if (seq_no > f.seq_no) return +1;
+ if (mem_seq_no < f.mem_seq_no) return -1;
+ if (mem_seq_no > f.mem_seq_no) return +1;
+ if (exe_seq_no < f.exe_seq_no) return -1;
+ if (exe_seq_no > f.exe_seq_no) return +1;
}
return id.compareTo(n.id);
}

Back to the top