mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-19 15:05:36 +02:00
Bug 291423 - [debug view] RejectedExecutionException when stepping fast past end of program.
This commit is contained in:
parent
9a35a91bd0
commit
94e7e1504c
2 changed files with 61 additions and 41 deletions
|
@ -11,8 +11,11 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.dsf.gdb.internal.ui.actions;
|
||||
|
||||
import java.util.concurrent.RejectedExecutionException;
|
||||
|
||||
import org.eclipse.cdt.dsf.concurrent.DsfExecutor;
|
||||
import org.eclipse.cdt.dsf.concurrent.DsfRunnable;
|
||||
import org.eclipse.cdt.dsf.concurrent.ImmediateExecutor;
|
||||
import org.eclipse.cdt.dsf.concurrent.RequestMonitor;
|
||||
import org.eclipse.cdt.dsf.datamodel.DMContexts;
|
||||
import org.eclipse.cdt.dsf.debug.service.IRunControl.IExecutionDMContext;
|
||||
|
@ -61,6 +64,7 @@ public class DsfTerminateCommand implements ITerminateHandler {
|
|||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
fExecutor.execute(
|
||||
new DsfRunnable() {
|
||||
public void run() {
|
||||
|
@ -77,6 +81,10 @@ public class DsfTerminateCommand implements ITerminateHandler {
|
|||
}
|
||||
}
|
||||
});
|
||||
} catch (RejectedExecutionException e) {
|
||||
request.setEnabled(false);
|
||||
request.done();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean execute(final IDebugCommandRequest request) {
|
||||
|
@ -85,14 +93,24 @@ public class DsfTerminateCommand implements ITerminateHandler {
|
|||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
fExecutor.submit(new DsfCommandRunnable(fTracker, request.getElements()[0], request) {
|
||||
@Override public void doExecute() {
|
||||
IGDBControl gdbControl = fTracker.getService(IGDBControl.class);
|
||||
if (gdbControl != null) {
|
||||
gdbControl.terminate(new RequestMonitor(fExecutor, null));
|
||||
gdbControl.terminate(new RequestMonitor(ImmediateExecutor.getInstance(), null) {
|
||||
@Override
|
||||
protected void handleCompleted() {
|
||||
request.setStatus(getStatus());
|
||||
request.done();
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
} catch (RejectedExecutionException e) {
|
||||
request.done();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -164,6 +164,7 @@ public class AbstractLaunchVMProvider extends AbstractDMVMProvider
|
|||
refreshStackFramesFuture.cancel(false);
|
||||
}
|
||||
|
||||
try {
|
||||
refreshStackFramesFuture = getSession().getExecutor().schedule(
|
||||
new DsfRunnable() {
|
||||
public void run() {
|
||||
|
@ -182,6 +183,7 @@ public class AbstractLaunchVMProvider extends AbstractDMVMProvider
|
|||
},
|
||||
FRAME_UPDATE_DELAY, TimeUnit.MILLISECONDS);
|
||||
fRefreshStackFramesFutures.put(exeContext, refreshStackFramesFuture);
|
||||
} catch (RejectedExecutionException e) {}
|
||||
} else if (event instanceof IRunControl.IResumedDMEvent) {
|
||||
IExecutionDMContext exeContext= ((IRunControl.IResumedDMEvent) event).getDMContext();
|
||||
ScheduledFuture<?> refreshStackFramesFuture= fRefreshStackFramesFutures.get(exeContext);
|
||||
|
|
Loading…
Add table
Reference in a new issue