diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence.java index 96debab4ef8..8f4a451cd7f 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence.java @@ -19,6 +19,7 @@ import org.eclipse.cdt.dsf.concurrent.DataRequestMonitor; import org.eclipse.cdt.dsf.concurrent.DsfExecutor; import org.eclipse.cdt.dsf.concurrent.RequestMonitor; import org.eclipse.cdt.dsf.concurrent.Sequence; +import org.eclipse.cdt.dsf.datamodel.DataModelInitializedEvent; import org.eclipse.cdt.dsf.datamodel.IDMContext; import org.eclipse.cdt.dsf.debug.service.IBreakpoints.IBreakpointsTargetDMContext; import org.eclipse.cdt.dsf.debug.service.ISourceLookup.ISourceLookupDMContext; @@ -509,6 +510,17 @@ public class FinalLaunchSequence extends Sequence { } } }, + /* + * Indicate that the Data Model has been filled. This will trigger the Debug view to expand. + */ + new Step() { + @Override + public void execute(final RequestMonitor requestMonitor) { + fLaunch.getSession().dispatchEvent(new DataModelInitializedEvent(fCommandControl.getContext()), + fCommandControl.getProperties()); + requestMonitor.done(); + } + }, /* * Cleanup */ diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/AbstractThreadVMNode.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/AbstractThreadVMNode.java index 396c291b13b..a75e755a0fa 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/AbstractThreadVMNode.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/AbstractThreadVMNode.java @@ -20,6 +20,7 @@ import org.eclipse.cdt.dsf.concurrent.DsfRunnable; import org.eclipse.cdt.dsf.concurrent.IDsfStatusConstants; import org.eclipse.cdt.dsf.concurrent.RequestMonitor; import org.eclipse.cdt.dsf.datamodel.DMContexts; +import org.eclipse.cdt.dsf.datamodel.DataModelInitializedEvent; import org.eclipse.cdt.dsf.datamodel.IDMContext; import org.eclipse.cdt.dsf.datamodel.IDMEvent; import org.eclipse.cdt.dsf.debug.service.IRunControl; @@ -243,7 +244,7 @@ public abstract class AbstractThreadVMNode extends AbstractDMVMNode rm.setStatus(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, IDsfStatusConstants.NOT_SUPPORTED, "", null)); //$NON-NLS-1$ rm.done(); return; - } else if (e instanceof ModelProxyInstalledEvent) { + } else if (e instanceof ModelProxyInstalledEvent || e instanceof DataModelInitializedEvent) { getThreadVMCForModelProxyInstallEvent( parentDelta, new DataRequestMonitor(getExecutor(), rm) { @@ -339,7 +340,7 @@ public abstract class AbstractThreadVMNode extends AbstractDMVMNode return IModelDelta.CONTENT; } else if (e instanceof SteppingTimedOutEvent) { return IModelDelta.CONTENT; - } else if (e instanceof ModelProxyInstalledEvent) { + } else if (e instanceof ModelProxyInstalledEvent || e instanceof DataModelInitializedEvent) { return IModelDelta.SELECT | IModelDelta.EXPAND; } return IModelDelta.NO_CHANGE; @@ -382,7 +383,7 @@ public abstract class AbstractThreadVMNode extends AbstractDMVMNode // the user that the program is running. parentDelta.addNode(createVMContext(dmc), IModelDelta.CONTENT); rm.done(); - } else if (e instanceof ModelProxyInstalledEvent) { + } else if (e instanceof ModelProxyInstalledEvent || e instanceof DataModelInitializedEvent) { // Model Proxy install event is generated when the model is first // populated into the view. This happens when a new debug session // is started or when the view is first opened. diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/LaunchRootVMNode.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/LaunchRootVMNode.java index 35a99d081ed..b5f9572c0a4 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/LaunchRootVMNode.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/LaunchRootVMNode.java @@ -15,6 +15,7 @@ import java.util.List; import org.eclipse.cdt.dsf.concurrent.DataRequestMonitor; import org.eclipse.cdt.dsf.concurrent.IDsfStatusConstants; +import org.eclipse.cdt.dsf.datamodel.DataModelInitializedEvent; import org.eclipse.cdt.dsf.internal.ui.DsfUIPlugin; import org.eclipse.cdt.dsf.ui.viewmodel.AbstractVMProvider; import org.eclipse.cdt.dsf.ui.viewmodel.IRootVMNode; @@ -73,7 +74,10 @@ public class LaunchRootVMNode extends RootVMNode { return false; } + } else if (e instanceof DataModelInitializedEvent) { + return true; } + return super.isDeltaEvent(rootObject, e); } @@ -85,6 +89,8 @@ public class LaunchRootVMNode extends RootVMNode if (le.fType == LaunchesEvent.Type.CHANGED || le.fType == LaunchesEvent.Type.TERMINATED) { flags = IModelDelta.STATE | IModelDelta.CONTENT; } + } else if (e instanceof DataModelInitializedEvent) { + flags = IModelDelta.EXPAND | IModelDelta.CONTENT; } return flags; @@ -121,8 +127,9 @@ public class LaunchRootVMNode extends RootVMNode } } } - } - + } else if (event instanceof DataModelInitializedEvent) { + rootDelta.setFlags(rootDelta.getFlags() | IModelDelta.EXPAND | IModelDelta.CONTENT); + } rm.setData(rootDelta); rm.done(); } diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/StackFramesVMNode.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/StackFramesVMNode.java index b471b826600..82fa626480a 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/StackFramesVMNode.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/StackFramesVMNode.java @@ -23,6 +23,7 @@ import org.eclipse.cdt.dsf.concurrent.DsfRunnable; import org.eclipse.cdt.dsf.concurrent.IDsfStatusConstants; import org.eclipse.cdt.dsf.concurrent.RequestMonitor; import org.eclipse.cdt.dsf.datamodel.DMContexts; +import org.eclipse.cdt.dsf.datamodel.DataModelInitializedEvent; import org.eclipse.cdt.dsf.datamodel.IDMContext; import org.eclipse.cdt.dsf.debug.service.IRunControl; import org.eclipse.cdt.dsf.debug.service.IStack; @@ -509,7 +510,7 @@ public class StackFramesVMNode extends AbstractDMVMNode */ @Override public void getContextsForEvent(final VMDelta parentDelta, Object e, final DataRequestMonitor rm) { - if (e instanceof ModelProxyInstalledEvent) { + if (e instanceof ModelProxyInstalledEvent || e instanceof DataModelInitializedEvent) { // Retrieve the list of stack frames, and mark the top frame to be selected. getVMProvider().updateNode( this, @@ -546,7 +547,7 @@ public class StackFramesVMNode extends AbstractDMVMNode return IModelDelta.CONTENT | IModelDelta.EXPAND; } else if (e instanceof SteppingTimedOutEvent) { return IModelDelta.CONTENT; - } else if (e instanceof ModelProxyInstalledEvent) { + } else if (e instanceof ModelProxyInstalledEvent || e instanceof DataModelInitializedEvent) { return IModelDelta.SELECT | IModelDelta.EXPAND; } else if (e instanceof ExpandStackEvent) { return IModelDelta.CONTENT; @@ -598,7 +599,7 @@ public class StackFramesVMNode extends AbstractDMVMNode buildDeltaForSuspendedEvent(execDmc, execDmc, parent, nodeOffset, rm); } else if (e instanceof SteppingTimedOutEvent) { buildDeltaForSteppingTimedOutEvent((SteppingTimedOutEvent)e, parent, nodeOffset, rm); - } else if (e instanceof ModelProxyInstalledEvent) { + } else if (e instanceof ModelProxyInstalledEvent || e instanceof DataModelInitializedEvent) { buildDeltaForModelProxyInstalledEvent(parent, nodeOffset, rm); } else if (e instanceof ExpandStackEvent) { IExecutionDMContext execDmc = ((ExpandStackEvent)e).getDMContext(); diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/datamodel/DataModelInitializedEvent.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/datamodel/DataModelInitializedEvent.java new file mode 100644 index 00000000000..9b128488ae9 --- /dev/null +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/datamodel/DataModelInitializedEvent.java @@ -0,0 +1,34 @@ +/******************************************************************************* + * Copyright (c) 2009 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 + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Wind River Systems - initial API and implementation + *******************************************************************************/ +package org.eclipse.cdt.dsf.datamodel; + +/** + * An event to signal the initial availability of the data model. + * + * @since 2.0 + */ +public class DataModelInitializedEvent extends AbstractDMEvent { + + /** + * Create an event for the given data model context. + * The context should represent the root of the data model hierarchy. + * + *

+ * Clients may instantiate and subclass. + *

+ * + * @param context the data model context + */ + public DataModelInitializedEvent(IDMContext context) { + super(context); + } + +}