1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

Bug 293109 - [debug view][view model] Terminate and Relaunch action not working.

This commit is contained in:
Pawel Piech 2010-10-08 18:15:45 +00:00
parent 7c8d11496e
commit 8c69e98515
3 changed files with 23 additions and 15 deletions

View file

@ -49,6 +49,7 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.DebugEvent;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.model.IDisconnect;
import org.eclipse.debug.core.model.IMemoryBlockRetrieval;
@ -287,10 +288,6 @@ public class GdbLaunch extends DsfLaunch
// 283586
DebugPlugin.getDefault().fireDebugEventSet( new DebugEvent[] { new DebugEvent(fMemRetrieval, DebugEvent.TERMINATE) });
// endSession takes a full dispatch to distribute the
// session-ended event, finish step only after the dispatch.
fExecutor.shutdown();
fExecutor = null;
fireTerminate();
rm.setStatus(getStatus());
@ -307,4 +304,13 @@ public class GdbLaunch extends DsfLaunch
Platform.getAdapterManager().loadAdapter(this, adapter.getName());
return super.getAdapter(adapter);
}
@Override
public void launchRemoved(ILaunch launch) {
if (this.equals(launch)) {
fExecutor.shutdown();
fExecutor = null;
}
super.launchRemoved(launch);
}
}

View file

@ -347,7 +347,7 @@ abstract public class AbstractVMProvider implements IVMProvider, IVMEventListene
eventInfo.fClientRm.done();
queue.fCurrentEvent = null;
queue.fCurrentRm = null;
if (!queue.fEventQueue.isEmpty()) {
if (!queue.fEventQueue.isEmpty() && !fDisposed) {
EventInfo nextEventInfo = queue.fEventQueue.remove(0);
doHandleEvent(queue, proxyStrategy, nextEventInfo);
}

View file

@ -35,15 +35,16 @@ import org.eclipse.core.runtime.PlatformObject;
abstract public class AbstractDMContext extends PlatformObject
implements IDMContext
{
private final String fSessionId;
private final DsfSession fSession;
private final IDMContext[] fParents;
/**
* Main constructor provides all data needed to implement the <code>IDMContext</code>
* interface.
* @since 2.2
*/
public AbstractDMContext(String sessionId, IDMContext[] parents) {
fSessionId = sessionId;
public AbstractDMContext(DsfSession session, IDMContext[] parents) {
fSession = session;
fParents = parents;
for (IDMContext parent : parents) {
assert(parent != null);
@ -52,7 +53,12 @@ abstract public class AbstractDMContext extends PlatformObject
/** Convenience constructor */
public AbstractDMContext(IDsfService service, IDMContext[] parents) {
this(service.getSession().getId(), parents);
this(service.getSession(), parents);
}
/** Backward compatiblity constructor */
public AbstractDMContext(String fSessionId, IDMContext[] parents) {
this(DsfSession.getSession(fSessionId), parents);
}
/**
@ -110,7 +116,7 @@ abstract public class AbstractDMContext extends PlatformObject
return retVal.toString();
}
public String getSessionId() { return fSessionId; }
public String getSessionId() { return fSession.getId(); }
public IDMContext[] getParents() { return fParents; }
/**
@ -131,11 +137,7 @@ abstract public class AbstractDMContext extends PlatformObject
@Override
@SuppressWarnings("rawtypes")
public Object getAdapter(Class adapterType) {
Object retVal = null;
DsfSession session = DsfSession.getSession(fSessionId);
if (session != null) {
retVal = session.getModelAdapter(adapterType);
}
Object retVal = fSession.getModelAdapter(adapterType);
if (retVal == null) {
retVal = super.getAdapter(adapterType);
}