1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-01 13:25:45 +02:00

Bug 404565 - [visualizer] Thread synchronization from multicore

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>
This commit is contained in:
Marc Dumais 2013-04-01 06:59:49 -04:00 committed by William Swanson
parent 9dc2e76ff2
commit d4bb0bba4d

View file

@ -7,10 +7,14 @@
* *
* Contributors: * Contributors:
* William R. Swanson (Tilera Corporation) - initial API and implementation * William R. Swanson (Tilera Corporation) - initial API and implementation
* Marc Dumais (Ericsson) - Bug 404565
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.dsf.gdb.multicorevisualizer.internal.utils; 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.debug.internal.ui.viewers.model.provisional.TreeModelViewer;
import org.eclipse.jface.viewers.TreePath; import org.eclipse.jface.viewers.TreePath;
import org.eclipse.swt.widgets.Tree; import org.eclipse.swt.widgets.Tree;
@ -57,7 +61,10 @@ public class DebugViewTreeWalker
*/ */
public void walk() public void walk()
{ {
walk(getRootPath()); TreePath roots[] = getRootPaths();
for(TreePath path : roots) {
walk(path);
}
} }
/** /**
@ -105,20 +112,26 @@ public class DebugViewTreeWalker
// --- tree path utilities --- // --- tree path utilities ---
/** Gets tree path of root element. */ /**
public TreePath getRootPath() * Gets tree path of root element(s).
* Note: each returned path is the root of a distinct debug session
*/
public TreePath[] getRootPaths()
{ {
// (?) This doesn't always return the expected root element. List<TreePath> paths = new ArrayList<TreePath>();
//return m_viewer.getTopElementPath();
TreePath path = null;
if (m_viewer != null) { if (m_viewer != null) {
Tree tree = (Tree) m_viewer.getControl(); Tree tree = (Tree) m_viewer.getControl();
TreeItem[] items = tree.getItems(); 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. */ /** Gets tree path for child element. */