Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: cbbba0f0c71bb5761aa09935458fa0cf9717eebf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*******************************************************************************
 * Copyright (c) 2006, 2010 Wind River Systems 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
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 *     Wind River Systems - initial API and implementation
 *     Ericsson			  - Modified for new functionality	
 *******************************************************************************/
package org.eclipse.cdt.examples.dsf.pda.ui.viewmodel.launch;

import org.eclipse.cdt.dsf.concurrent.ThreadSafe;
import org.eclipse.cdt.dsf.debug.ui.viewmodel.launch.AbstractLaunchVMProvider;
import org.eclipse.cdt.dsf.debug.ui.viewmodel.launch.LaunchRootVMNode;
import org.eclipse.cdt.dsf.debug.ui.viewmodel.launch.StackFramesVMNode;
import org.eclipse.cdt.dsf.debug.ui.viewmodel.launch.StandardProcessVMNode;
import org.eclipse.cdt.dsf.service.DsfSession;
import org.eclipse.cdt.dsf.ui.viewmodel.AbstractVMAdapter;
import org.eclipse.cdt.dsf.ui.viewmodel.IRootVMNode;
import org.eclipse.cdt.dsf.ui.viewmodel.IVMNode;
import org.eclipse.debug.core.IDebugEventSetListener;
import org.eclipse.debug.core.ILaunchesListener2;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;


/**
 * View Model provider for the Launch (AKA Debug) view. The launch VM 
 * provider is configured with three nodes:
 * <ul>
 * <li> LaunchRootVMNode - This is the root of the PDA view model.</li>  
 * <li> PDAVirtualMachineVMNode - Supplies the element representing PDA VM</li>
 * <li> PDAThreadsVMNode - Supplies the PDA thread elements</li>
 * <li> StackFramesVMNode - Supplies the stack frame elements.</li>  
 * <li> StandardProcessVMNode - Supplies elements representing the PDA 
 * debugger process.</li>
 * </ul> 
 */
@SuppressWarnings("restriction")
public class PDALaunchVMProvider extends AbstractLaunchVMProvider 
    implements IDebugEventSetListener, ILaunchesListener2
{
    @ThreadSafe
    public PDALaunchVMProvider(AbstractVMAdapter adapter, IPresentationContext presentationContext, DsfSession session) 
    {
        super(adapter, presentationContext, session);
        
        IRootVMNode launchNode = new LaunchRootVMNode(this);
        setRootNode(launchNode);

        // Launch node is a parent to the processes and program nodes.
        IVMNode pdaVirtualMachineNode = new PDAVirtualMachineVMNode(this, getSession());
        IVMNode processesNode = new StandardProcessVMNode(this);
        addChildNodes(launchNode, new IVMNode[] { pdaVirtualMachineNode, processesNode});
        
        // Virtual machine node is under the PDA threads node.
        IVMNode threadsNode = new PDAThreadsVMNode(this, getSession());
        addChildNodes(pdaVirtualMachineNode, new IVMNode[] { threadsNode });
        
        // Stack frames node is under the PDA threads node.
        IVMNode stackFramesNode = new StackFramesVMNode(this, getSession());
        addChildNodes(threadsNode, new IVMNode[] { stackFramesNode });
    }
}

Back to the top