1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 02:06:01 +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.DebugEvent;
import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.DebugPlugin; import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.model.IDisconnect; import org.eclipse.debug.core.model.IDisconnect;
import org.eclipse.debug.core.model.IMemoryBlockRetrieval; import org.eclipse.debug.core.model.IMemoryBlockRetrieval;
@ -287,10 +288,6 @@ public class GdbLaunch extends DsfLaunch
// 283586 // 283586
DebugPlugin.getDefault().fireDebugEventSet( new DebugEvent[] { new DebugEvent(fMemRetrieval, DebugEvent.TERMINATE) }); 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(); fireTerminate();
rm.setStatus(getStatus()); rm.setStatus(getStatus());
@ -307,4 +304,13 @@ public class GdbLaunch extends DsfLaunch
Platform.getAdapterManager().loadAdapter(this, adapter.getName()); Platform.getAdapterManager().loadAdapter(this, adapter.getName());
return super.getAdapter(adapter); 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(); eventInfo.fClientRm.done();
queue.fCurrentEvent = null; queue.fCurrentEvent = null;
queue.fCurrentRm = null; queue.fCurrentRm = null;
if (!queue.fEventQueue.isEmpty()) { if (!queue.fEventQueue.isEmpty() && !fDisposed) {
EventInfo nextEventInfo = queue.fEventQueue.remove(0); EventInfo nextEventInfo = queue.fEventQueue.remove(0);
doHandleEvent(queue, proxyStrategy, nextEventInfo); doHandleEvent(queue, proxyStrategy, nextEventInfo);
} }

View file

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