1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-16 21:45:22 +02:00

[247010] - Rolled back the check for session.isActive() before returning the adapter set.

This commit is contained in:
Pawel Piech 2008-09-12 20:20:51 +00:00
parent 8968ec763d
commit 66960d32ba
3 changed files with 21 additions and 11 deletions

View file

@ -10,6 +10,8 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel; package org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel;
import java.util.concurrent.RejectedExecutionException;
import org.eclipse.dd.dsf.concurrent.DsfRunnable; import org.eclipse.dd.dsf.concurrent.DsfRunnable;
import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.SteppingController.ISteppingControlParticipant; import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.SteppingController.ISteppingControlParticipant;
import org.eclipse.dd.dsf.debug.service.IRunControl; import org.eclipse.dd.dsf.debug.service.IRunControl;
@ -32,11 +34,13 @@ public class AbstractDebugVMAdapter extends AbstractDMVMAdapter
public AbstractDebugVMAdapter(DsfSession session, final SteppingController controller) { public AbstractDebugVMAdapter(DsfSession session, final SteppingController controller) {
super(session); super(session);
fController = controller; fController = controller;
fController.getExecutor().execute(new DsfRunnable() { try {
public void run() { fController.getExecutor().execute(new DsfRunnable() {
fController.addSteppingControlParticipant(AbstractDebugVMAdapter.this); public void run() {
} fController.addSteppingControlParticipant(AbstractDebugVMAdapter.this);
}); }
});
} catch (RejectedExecutionException e) {} // Do nothing if session is shut down.
} }
private final SteppingController fController; private final SteppingController fController;
@ -60,13 +64,13 @@ public class AbstractDebugVMAdapter extends AbstractDMVMAdapter
@Override @Override
public void dispose() { public void dispose() {
if (!fController.getExecutor().isShutdown()) { try {
fController.getExecutor().execute(new DsfRunnable() { fController.getExecutor().execute(new DsfRunnable() {
public void run() { public void run() {
fController.removeSteppingControlParticipant(AbstractDebugVMAdapter.this); fController.removeSteppingControlParticipant(AbstractDebugVMAdapter.this);
} }
}); });
} } catch (RejectedExecutionException e) {} // Do nothing if session is shut down.
super.dispose(); super.dispose();
} }
} }

View file

@ -187,9 +187,12 @@ public class PDAAdapterFactory implements IAdapterFactory, ILaunchesListener2
PDALaunch launch = (PDALaunch)adaptableObject; PDALaunch launch = (PDALaunch)adaptableObject;
// check for valid session // Check for valid session.
// Note: even if the session is no longer active, the adapter set
// should still be returned. This is because the view model may still
// need to show elements representing a terminated process/thread/etc.
DsfSession session = launch.getSession(); DsfSession session = launch.getSession();
if (session == null || !session.isActive()) return null; if (session == null) return null;
// Find the correct set of adapters based on the launch. If not found // Find the correct set of adapters based on the launch. If not found
// it means that we have a new launch, and we have to create a // it means that we have a new launch, and we have to create a

View file

@ -208,9 +208,12 @@ public class GdbAdapterFactory
GdbLaunch launch = (GdbLaunch)adaptableObject; GdbLaunch launch = (GdbLaunch)adaptableObject;
// check for valid session // Check for valid session.
// Note: even if the session is no longer active, the adapter set
// should still be returned. This is because the view model may still
// need to show elements representing a terminated process/thread/etc.
DsfSession session = launch.getSession(); DsfSession session = launch.getSession();
if (session == null || !session.isActive()) return null; if (session == null) return null;
// Find the correct set of adapters based on the launch session-ID. If not found // Find the correct set of adapters based on the launch session-ID. If not found
// it means that we have a new launch and new session, and we have to create a // it means that we have a new launch and new session, and we have to create a