Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2015-07-30 20:42:56 -0400
committerEugene Tarassov2015-07-30 20:42:56 -0400
commit8a56a8e9098eb4ea1b16de9cac1773e3b4f06538 (patch)
tree6248fd940737ead98fac628a3dee9fd92c347067 /plugins
parent1b7b7252370d26d27061b107eebfe3fb5a95f1d9 (diff)
downloadorg.eclipse.tcf-8a56a8e9098eb4ea1b16de9cac1773e3b4f06538.tar.gz
org.eclipse.tcf-8a56a8e9098eb4ea1b16de9cac1773e3b4f06538.tar.xz
org.eclipse.tcf-8a56a8e9098eb4ea1b16de9cac1773e3b4f06538.zip
TCF Debugger: fixed order of entries in the Modules view
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFChildrenModules.java6
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeModule.java15
2 files changed, 18 insertions, 3 deletions
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFChildrenModules.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFChildrenModules.java
index d9adcff32..194c90e0f 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFChildrenModules.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFChildrenModules.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Wind River Systems, Inc. and others.
+ * Copyright (c) 2011, 2015 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
@@ -36,12 +36,14 @@ public class TCFChildrenModules extends TCFChildren {
TCFDataCache<MemoryRegion[]> map_cache = exe.getMemoryMap();
if (!map_cache.validate(this)) return false;
MemoryRegion[] map = map_cache.getData();
- Map<String, TCFNode> data = new HashMap<String, TCFNode>();
+ Map<String,TCFNode> data = new HashMap<String,TCFNode>();
if (map != null) {
+ int cnt = 0;
for (int index = 0; index < map.length; index++) {
String id = exe.id + ".Module-" + index;
TCFNodeModule module = (TCFNodeModule)node.model.getNode(id);
if (module == null) module = new TCFNodeModule(exe, id, index);
+ module.setSortPosition(cnt++);
data.put(id, module);
}
}
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeModule.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeModule.java
index f7aeb6e24..9b890d78f 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeModule.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeModule.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Wind River Systems, Inc. and others.
+ * Copyright (c) 2011, 2015 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
@@ -31,6 +31,7 @@ import org.eclipse.tcf.util.TCFDataCache;
public class TCFNodeModule extends TCFNode implements IDetailsProvider {
private final TCFData<MemoryRegion> region;
+ private int sort_pos;
protected TCFNodeModule(final TCFNodeExecContext parent, String id, final int index) {
super(parent, id);
@@ -53,6 +54,10 @@ public class TCFNodeModule extends TCFNode implements IDetailsProvider {
return region;
}
+ void setSortPosition(int sort_pos) {
+ this.sort_pos = sort_pos;
+ }
+
void onMemoryMapChanged() {
region.reset();
}
@@ -181,4 +186,12 @@ public class TCFNodeModule extends TCFNode implements IDetailsProvider {
else flagsLabel.append('-');
return flagsLabel.toString();
}
+
+ @Override
+ public int compareTo(TCFNode n) {
+ TCFNodeModule e = (TCFNodeModule)n;
+ if (sort_pos < e.sort_pos) return -1;
+ if (sort_pos > e.sort_pos) return +1;
+ return 0;
+ }
}

Back to the top