summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Dumais2013-04-01 06:59:49 (EDT)
committerWilliam Swanson2013-04-01 10:51:32 (EDT)
commitd4bb0bba4d448dc6c8e69d1202795545860a668d (patch)
treebbc7eb0fbc4df8285ca3754ca791f2e989a49107
parent9dc2e76ff2bed9f8e386b268f9a00134499b9f40 (diff)
downloadorg.eclipse.cdt-d4bb0bba4d448dc6c8e69d1202795545860a668d.zip
org.eclipse.cdt-d4bb0bba4d448dc6c8e69d1202795545860a668d.tar.gz
org.eclipse.cdt-d4bb0bba4d448dc6c8e69d1202795545860a668d.tar.bz2
Bug 404565 - [visualizer] Thread synchronization from multicorerefs/changes/47/11547/3
visualizer to debug view only works for first session Change-Id: I89cbd25169630f862129546f3ec1b3d652ee8dee Reviewed-on: https://git.eclipse.org/r/11547 IP-Clean: William Swanson <traveler@tilera.com> Tested-by: William Swanson <traveler@tilera.com> Reviewed-by: William Swanson <traveler@tilera.com>
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/utils/DebugViewTreeWalker.java33
1 files changed, 23 insertions, 10 deletions
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/utils/DebugViewTreeWalker.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/utils/DebugViewTreeWalker.java
index 5f7776d..ebf1133 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/utils/DebugViewTreeWalker.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/utils/DebugViewTreeWalker.java
@@ -7,10 +7,14 @@
*
* Contributors:
* William R. Swanson (Tilera Corporation) - initial API and implementation
+ * Marc Dumais (Ericsson) - Bug 404565
*******************************************************************************/
package org.eclipse.cdt.dsf.gdb.multicorevisualizer.internal.utils;
+import java.util.ArrayList;
+import java.util.List;
+
import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.swt.widgets.Tree;
@@ -57,7 +61,10 @@ public class DebugViewTreeWalker
*/
public void walk()
{
- walk(getRootPath());
+ TreePath roots[] = getRootPaths();
+ for(TreePath path : roots) {
+ walk(path);
+ }
}
/**
@@ -105,20 +112,26 @@ public class DebugViewTreeWalker
// --- tree path utilities ---
- /** Gets tree path of root element. */
- public TreePath getRootPath()
- {
- // (?) This doesn't always return the expected root element.
- //return m_viewer.getTopElementPath();
+ /**
+ * Gets tree path of root element(s).
+ * Note: each returned path is the root of a distinct debug session
+ */
+ public TreePath[] getRootPaths()
+ {
+ List<TreePath> paths = new ArrayList<TreePath>();
- TreePath path = null;
if (m_viewer != null) {
Tree tree = (Tree) m_viewer.getControl();
TreeItem[] items = tree.getItems();
- Object root = (items == null || items.length == 0) ? null : items[0].getData();
- if (root != null) path = new TreePath(new Object[] {root});
+
+ for (TreeItem item : items) {
+ Object root = (item == null) ? null : item.getData();
+ if (root != null) {
+ paths.add(new TreePath(new Object[] {root}));
+ }
+ }
}
- return path;
+ return paths.toArray(new TreePath[paths.size()]);
}
/** Gets tree path for child element. */